ProgrammingEasyWipro · Capgemini pattern

In Java, which keyword makes one class inherit from another class?

  1. A. inherits
  2. B. extends
  3. C. implements
  4. D. super

Correct answer: B. extends

class B extends A makes B a subclass of A. implements is used for interfaces; super refers to the parent inside the subclass.

More OOP with C++ and Java questions

Exams that ask this topic