CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Method Hiding vs Overriding

C# quiz · Question 50
hardInheritance

What does this code print?

Code

1class A {
2 public virtual void Show() { Console.Write("A"); }
3}
4class B : A {
5 public override void Show() { Console.Write("B"); }
6}
7class C : B {
8 public new void Show() { Console.Write("C"); }
9}
10 
11A obj = new C();
12obj.Show();