1z0-808 Exam QuestionsBrowse all questions from this exam

1z0-808 Exam - Question 230


Examine the given definitions:

and the code fragment:

Which statement is true about the implementation of Object-Oriented Programming concepts in the given code?

Show Answer
Correct Answer: AB

Polymorphism is implemented because the code creates an instance of the Game class but assigns it to a Playable interface reference (Playable p), allowing the method play() to be called at runtime. Abstraction is implemented through the Playable interface, which provides a set of operations (play and setPlayers) that must be implemented without specifying how they should be executed. Encapsulation is also implemented, as the players list in the Game class is private and is accessed or modified through the public getters and setters.

Discussion

4 comments
Sign in to comment
pbbvrOption: A
Aug 12, 2023

Letter A

dsmsOption: C
Aug 19, 2023

C. Polymorphism, inheritance, and abstraction are implemented.

jtyc000Option: A
Feb 7, 2024

No extends keyword, should not be inheritance. By elimination, only A left

hajime123Option: C
Apr 29, 2024

Answer is C