1.

If a function declared as abstract in base class doesn’t have to be defined in derived class then ______(a) Derived class must define the function anyhow(b) Derived class should be made abstract class(c) Derived class should not derive from that base class(d) Derived class should not use that functionThe question was posed to me during an interview.The question is from Abstract Function in division Member Functions & its Types of Object Oriented Programming

Answer»

The correct choice is (b) Derived CLASS should be made abstract class

To explain: If the FUNCTION that is not to be defined in derived class but is declared as abstract in BASE class then the derived class must be made an abstract class. This will make the concept MANDATORY that the derived class must have one SUBCLASS to define that method.



Discussion

No Comment Found

Related InterviewSolutions