1.

If there is an abstract method in a class then, ________________(a) Class must be abstract class(b) Class may or may not be abstract class(c) Class is generic(d) Class must be publicThis question was posed to me in a job interview.My doubt is from Abstract Class in chapter Classes of Object Oriented Programming

Answer»

Right option is (a) Class MUST be ABSTRACT class

The EXPLANATION: It is a rule that if a class have even one abstract method, it must be an abstract class. If this rule was not made, the abstract methods WOULD have got skipped to get defined in some places which are UNDESIRABLE with the idea of abstract class.



Discussion

No Comment Found

Related InterviewSolutions