1z0-809 Exam QuestionsBrowse all questions from this exam

1z0-809 Exam - Question 205


Given the definition of the Vehicle class:

Which action encapsulates the Vehicle class?

Show Answer
Correct Answer: BD

To encapsulate the Vehicle class, the name variable should be made private. This restricts direct access to the variable from outside the class, ensuring that it can only be accessed or modified through the public getName() and setName() methods. Encapsulation helps protect the integrity of the data by controlling how the data is accessed and modified.

Discussion

5 comments
Sign in to comment
ayzoOption: D
Jan 25, 2021

D is the answer

WilsonKKerllOption: D
Mar 21, 2022

Answer is D.

duydnOption: D
Sep 22, 2023

I think C & D are correct if have to change with 2 actions

steefaandOption: D
Feb 7, 2024

C and D should be correct.

DarGrinOption: D
Jun 7, 2024

C and D are correct. Since we should choose only 1 answer -> D