The process of hiding object data and providing methods for data access is called ______________________.
encapsulation
Oops!
Check
Okay!
Check
10
Given the above class definition, which of the following are considered part of the classโs public interface?
updatePrice and designCode
Oops!
Check
Okay!
Check
10
You should declare all instance variables as ____________________.
private
Oops!
Check
Okay!
Check
10
The ______________ keyword is used to construct an object from a class.
new
Oops!
Check
Okay!
Check
10
A method in a class that returns information about an object but does not change the object is called a/an _________________ method.
accessor
Oops!
Check
Okay!
Check
10
True or False: The default value for an instance variable of type String is void.
False
Oops!
Check
Okay!
Check
10
The getMonth() method in the code segment above can be considered an/a _______________ method. (accessor/mutator)
accessor
Oops!
Check
Okay!
Check
eraser
Reset score!
Oops!
seesaw
Swap points!
Okay!
rocket
Go to first place!
Okay!
baam
Lose 15 points!
Oops!
10
Data required for an object's use are stored in _________________.
instance variables
Oops!
Check
Okay!
Check
10
True or False: When a method that specifies a return type other than void is called and completes its task, the method must return a result to its calling method.
True
Oops!
Check
Okay!
Check
10
True or False: Classes often provide public methods to allow the classโs clients to set or get private instance variables; the names of these methods must begin with set or get.
False
Oops!
Check
Okay!
Check
10
Write the line of code that declares a sideLength instance variable for a Square class that stores an integer value.
private int sideLength;
Oops!
Check
Okay!
Check
10
True or False: To call a method of an object, follow the object name with a comma, the method name and a set of parentheses containing the methodโs arguments.
False
Oops!
Check
Okay!
Check
10
A method in a class that modifies information about an object is called a/an ________________ method.