Creating Superclasses and Subclasses

AP Computer Science A· difficulty 4/5

Which statement about abstract classes in Java is correct?

  • A

    Any class with a constructor is automatically abstract

  • B

    Abstract classes cannot have any methods

  • C

    Abstract classes cannot have constructors

  • D

    An abstract class can have constructors and concrete methods, but cannot be instantiated directly

    check_circle

Explanation

Abstract classes serve as base classes; they may include constructors (called by subclasses via super()) and concrete methods. They just can't be <code>new</code>'d directly.

Want 10 more like this — adaptive to your weak spots?

Related questions