Which of the following demonstrates the implementation of inheritance in Java?
Show answerHide answer
Correct answer: (D) class A extends B {}
Explanation
Java uses the keyword extends for class inheritance, e.g. class A extends B. implements is used when a class implements an interface; inherits and contains are not Java keywords.