True or False: A class can have more than one constructor.
True
Oops!
Check
Okay!
Check
10
True or False: A call to a constructor must always have construction parameters.
False
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
True or False: A constructor must have the same name as the class name.
True
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?
Motorcycle myBike = new Motorcycle();
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
banana
Go to last place!
Oops!
fairy
Take points!
5
10
15
20
25
gift
Win 20 points!
Okay!
banana
Go to last place!
Oops!
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
True or False: A constructor should always return a value.
False
Oops!
Check
Okay!
Check
thief
Give points!
5
10
15
20
25
rocket
Go to first place!
Okay!
gift
Win 20 points!
Okay!
thief
Give points!
5
10
15
20
25
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: A constructor initializes the instance variables of an object.
True
Oops!
Check
Okay!
Check
10
A constructor is invoked when _________________ to create an object.
the new keyword is used
Oops!
Check
Okay!
Check
10
True or False: Private instance variables are the interface to the class.