Which of the following represents the final output of the code segment above?
22
Oops!
Check
Okay!
Check
10
When an object is created from a class, the object is called a/an ________________ of the class.
instance
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
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
You should declare all instance variables as ____________________.
private
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
seesaw
Swap points!
Oops!
gold
Win 50 points!
Okay!
shark
Other team loses 25 points!
Okay!
baam
Lose 25 points!
Oops!
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
Given class Counter above, what output is generated by the code segment?
2 1
Oops!
Check
Okay!
Check
10
Given class Counter, how many instances of the Counter class are created in the code segment?
2
Oops!
Check
Okay!
Check
10
Consider the above code segment. Class Date contains ______ instance variables.
3
Oops!
Check
Okay!
Check
seesaw
Swap points!
Oops!
seesaw
Swap points!
Okay!
rocket
Go to first place!
Okay!
lifesaver
Give 15 points!
Oops!
10
A method in a class that modifies information about an object is called a/an ________________ method.
mutator
Oops!
Check
Okay!
Check
monster
Reset all scores!
Oops!
star
Double points!
Okay!
fairy
Take points!
5
10
15
20
25
lifesaver
Give 25 points!
Oops!
10
The process of hiding object data and providing methods for data access is called ______________________.
encapsulation
Oops!
Check
Okay!
Check
10
The getMonth() method in the code segment above can be considered an/a _______________ method. (accessor/mutator)