Professional Documents
Culture Documents
Date:
Section:
III. Accessors/Mutators
IV. Methods the class uses for itself, but the user does not need
A. I, II, IV
B. I, II, III
C. I, III, V
D. I, II, III, V
A. A getter method allows you to get the value of a field while an accessor method sets the value of the field.
B. A getter method allows you to get the value of a field while an accessor method is not often used in Java.
C. A getter method gets the name of the class while an accessor method gets the value of the field.
D. There is no difference. They refer to the same idea.
A. Allow private data to be accessed outside of the class and be safely modified.
B. Allow users to access and modify any of the class’s data in any way they wish.
C. Prevent users from manipulating private data.
D. Allow public data to be accessed and safely modified.
A. private to prevent any user from accessing and modifying any instance variables.
B. private so that only certain users can create objects of the class.
C. public so that all data and methods are accessible by any user.
D. public so that any user can create and use objects of the class.