C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 190 Page Views: 

What will be result of this code: class C1 { protected int A = 0; public void B() { console.writeLine(A); }} class C2 : C1 {public void B() { Console.WriteLine(A+10); }} static void Main(string[] args) { C1 c = new C2(); c.B(); }



Posted By: Avi Date: 13 October 2010 11:27:47 PM
 Answer:

Waiting for someone to answer

Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image BY9KJF
Related Questions
C# : What is the meaning of the lock keyword?

What is the meaning of the lock keyword?

Lock marks a block of code as critical section by obtaining the mutual-exclusion lock for a given ob....
Category: C# Date: 10/14/2010 11:59:47 AM
C# : How do you use StreamWriter to write text to file?

How do you use StreamWriter to write text to file?

StreamWriter sw = new StreamWriter(filename); sw.WriteLine(“text”);sw.Close();
Category: C# Date: 10/14/2010 11:50:46 AM
C# : How do you use StringBuilder class?

How do you use StringBuilder class?

StringBuilder sb = new StringBuilder(); sb.Append(123).Append(“aaa”); sb.ToString();
Category: C# Date: 10/14/2010 11:38:31 AM
C# : Will this code Compie?
Public Interface ISomething { public void Sub();}
C# : Can this methods have the same name void A(ref int a); void A(out int a);

Can this methods have the same name void A(ref int a); void A(out int a);

No, ref and out are not part of the method signature
Category: C# Date: 10/14/2010 10:48:14 AM