ProgrammingHardGATE CS · TCS NQT Prime · Product Company SDE

Which statement correctly distinguishes an abstract class from an interface in Java (interfaces may have default/static/private methods since Java 8/9)?

  1. A. An abstract class can declare constructors and hold instance fields with real per-object state; a plain interface cannot hold mutable instance state
  2. B. An interface can declare constructors but an abstract class cannot
  3. C. Abstract classes can never contain a concrete (non-abstract) method
  4. D. A class may extend any number of abstract classes but only implement one interface

Correct answer: A. An abstract class can declare constructors and hold instance fields with real per-object state; a plain interface cannot hold mutable instance state

Abstract classes behave like ordinary classes (constructors, instance fields, partial implementation); interfaces only expose constants (implicitly public static final fields), never per-instance mutable state.

More OOP with C++ and Java questions

Exams that ask this topic