Exam 1z0-809 All QuestionsBrowse all questions from this exam
Question 205

Given the definition of the Vehicle class:

Which action encapsulates the Vehicle class?

    Correct Answer: D

    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
ayzoOption: D

D is the answer

DarGrinOption: D

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

steefaandOption: D

C and D should be correct.

duydnOption: D

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

WilsonKKerllOption: D

Answer is D.