1.

Which among the following best describes abstract classes?(a) If a class has more than one virtual function, it’s abstract class(b) If a class have only one pure virtual function, it’s abstract class(c) If a class has at least one pure virtual function, it’s abstract class(d) If a class has all the pure virtual functions only, then it’s abstract classI had been asked this question during a job interview.I'm obligated to ask this question of Abstract Class topic in division Classes of Object Oriented Programming

Answer»

Correct answer is (c) If a class has at least one PURE VIRTUAL function, it’s ABSTRACT class

To EXPLAIN: The condition for a class to be called abstract class is that it must have at least one pure virtual function. The keyword abstract must be USED while defining abstract class in java.



Discussion

No Comment Found

Related InterviewSolutions