CJCoding With Joseph
← Back to Question List

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

Topics:
C# Quiz #50

Method Hiding vs Overriding

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();