ProgrammingModerateCognizant GenC · Accenture

Which statement about abstract classes in Java is correct?

  1. A. An abstract class can be instantiated with new if all its methods are implemented
  2. B. An abstract class cannot contain any concrete method
  3. C. An abstract class may declare constructors, which run when a subclass object is created
  4. D. A class containing an abstract method need not be declared abstract

Correct answer: C. An abstract class may declare constructors, which run when a subclass object is created

Abstract classes cannot be instantiated directly, but their constructors are invoked through the subclass constructor chain; they can mix abstract and concrete methods.

More OOP with C++ and Java questions

Exams that ask this topic