Correct Answer: When overriding a method, the names and type signatures of the override method must be the same as the virtual method that is being overriden.
5. In order for an instance of a derived class to completely take over a class member from a base class, the base class has to declare that member as
Correct Answer: DerivedSample class hides the fun() method of base class.
7. Which of the following keyword is used to change the data and behavior of a base class by replacing a member of a base class with a new derived member?
Correct Answer: When used as a modifier, the new keyword explicitly hides a member inherited from a base class.
9. Which of the following statements is correct?
Options
A. Only one object can be created from an abstract class.
B. By default methods are virtual.
C. If a derived class does not provide its own version of virtual method then the one in the base class is used.
D. If the method in the derived class is not preceded by override keywords, the compiler will issue a warning and the method will behave as if the override keyword were present.
E. Each derived class does not have its own version of a virtual method.