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

Given the definition of the Book class:

Which statement is true about the Book class?

    Correct Answer: A

    The Book class demonstrates encapsulation. Encapsulation is the principle of wrapping the data (fields) and the code that manipulates the data (methods) together as a single unit. In this class, the fields 'id' and 'name' are private, and access to these fields is provided through public getter and setter methods, which is a standard example of encapsulation.

Discussion
steefaandOption: A

A is correct since all fields are private and getter and setter methods are public.

duydnOption: A

A is correct. Reason: make fields are private and provide setter and getter methods.

samtash1034Option: A

a,tested