Quiz #8

1. Briefly describe the notion of polymorphism; use the terms "virtual" and "override" in your answer.

 

2. a) Say you have defined a class named "X" and that you include a "ToString()" method to display the contents of an X-type object. Explain what happens when the following code executes:

X y = new X();
Console.WriteLine(y);

2. b) Explain what happens in the code above if you don't include a "ToString()" method in your class X.