Exam 1z0-808 All QuestionsBrowse all questions from this 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?

    Correct Answer: A

    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
pbbvrOption: A

Letter A

jtyc000Option: A

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

dsmsOption: C

C. Polymorphism, inheritance, and abstraction are implemented.

hajime123Option: C

Answer is C