Given the definition of the Book class:
Which statement is true about the Book class?
Given the definition of the Book class:
Which statement is true about the Book class?
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.
A is correct since all fields are private and getter and setter methods are public.
A is correct. Reason: make fields are private and provide setter and getter methods.
a,tested