1Z0-803 · Question #41
Which two statements are true?
The correct answer is A. An abstract class can implement an interface. E. An abstract class can be extended by a concrete class.. This question evaluates knowledge of core object-oriented programming concepts related to inheritance and interface implementation rules between abstract classes, concrete classes, and interfaces.
Question
Which two statements are true?
Options
- AAn abstract class can implement an interface.
- BAn abstract class can be extended by an interface.
- CAn interface CANNOT be extended by another interface.
- DAn interface can be extended by an abstract class.
- EAn abstract class can be extended by a concrete class.
- FAn abstract class CANNOT be extended by an abstract class.
How the community answered
(17 responses)- A94% (16)
- D6% (1)
Why each option
This question evaluates knowledge of core object-oriented programming concepts related to inheritance and interface implementation rules between abstract classes, concrete classes, and interfaces.
An abstract class can implement one or more interfaces. It is not required to provide concrete implementations for all interface methods; any unimplemented methods remain abstract, and the class itself remains abstract.
Interfaces cannot extend classes (abstract or concrete). Interfaces extend other interfaces to form an inheritance hierarchy for interface contracts.
Interfaces can indeed extend other interfaces, allowing for the combination of method signatures from multiple interfaces into a single new interface.
An abstract class *implements* an interface; it does not *extend* it. Extension (`extends`) is used for class-to-class inheritance or interface-to-interface inheritance.
A concrete class can extend an abstract class. When a concrete class extends an abstract class, it is obligated to provide concrete implementations for all abstract methods inherited from its abstract superclass.
An abstract class can be extended by another abstract class. This allows for creating hierarchies of abstraction, where a subclass abstract class can further define or override abstract methods.
Concept tested: OOP inheritance and interface implementation rules
Source: https://docs.oracle.com/javase/tutorial/java/IandI/abstract.html
Topics
Community Discussion
No community discussion yet for this question.