True or False: A class can have only one constructor.
False
Oops!
Check
Okay!
Check
10
If you do not provide a constructor in a class, which of the following is correct?
The compiler will generate a constructor with no arguments.
Oops!
Check
Okay!
Check
10
True or False: A constructor must have the same name as the class name.
True
Oops!
Check
Okay!
Check
10
True or False: A call to a constructor must always have construction parameters.
False
Oops!
Check
Okay!
Check
baam
Lose 20 points!
Oops!
shark
Other team loses 10 points!
Okay!
rocket
Go to first place!
Okay!
thief
Give points!
5
10
15
20
25
monster
Reset all scores!
Oops!
gift
Win 5 points!
Okay!
gift
Win 15 points!
Okay!
banana
Go to last place!
Oops!
10
True or False: A constructor initializes the instance variables of an object.
True
Oops!
Check
Okay!
Check
boom
Lose 50 points!
Oops!
magnet
Take 25 points!
Okay!
shark
Other team loses 25 points!
Okay!
baam
Lose 25 points!
Oops!
10
What is wrong with this code?
The constructor must not have a return type declared.
Oops!
Check
Okay!
Check
10
True or False: A constructor should always return a value.
False
Oops!
Check
Okay!
Check
10
True or False: A class can have more than one constructor.
True
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: All instance variables should be declared as private and most instance methods should be declared as public
True
Oops!
Check
Okay!
Check
10
You are creating a class named Employee. What is the statement that correctly declares a constructor for this class?
public Employee()
Oops!
Check
Okay!
Check
10
You have created a Motorcycle class which has a constructor with no parameters. Which of the following statements will construct an object of this class?