49
Answer (Choose 1 answer)
What is the output of the following code?
public class A
{
public virtual void Talk() { Console.WriteLine("A ");
}
}
public class B: A
public override void Talk(){
Console.WriteLine("B ");
}
}
public class C: B
public class Program
static void Main(string[] args)
A C1 = new C();C1.Talk();
Console.ReadLine();
}
}
A. B
B. A
C. AB
D. This code will raise an exception since class C is not overriding the Talk() method.
Elt