Quiz
Let's test your understanding of the concept of polymorphism with the help of a short quiz.
We'll cover the following...
We'll cover the following...
Technical Quiz
1.
What is the output of the following piece of code?
class Base {
public Base() {}
public void Print() {
Console.WriteLine("Base");
}
}
class Derived : Base {
public Derived() {}
public new void Print() {
Console.WriteLine("Derived");
}
}
class Demo {
public static void Main(string[] args) {
Base obj = new Derived();
obj.Print();
}
}
A.
Base
B.
Base Derived
C.
Derived
D.
None of the above
1 / 4