1z0-803 Exam QuestionsBrowse all questions from this exam

1z0-803 Exam - Question 22


Given:

Which two classes use the shape class correctly?

Show Answer
Correct Answer: BE

When deriving a non-abstract subclass from an abstract class, the subclass must provide implementations for all abstract methods inherited from the abstract class. In this case, the class Circle needs to provide an implementation for the abstract method draw() from the Shape class. Therefore, Option E is correct because it extends Shape and provides an implementation for draw(). Additionally, if a subclass does not provide implementations for all abstract methods, it must also be declared abstract to be valid. This is the case in Option B. Hence, Options B and E use the Shape class correctly.

Discussion

1 comment
Sign in to comment
Temilaw25
Jan 26, 2022

Also, to add, you cannot implement an abstract class, only interfaces can be implemented.