Quiz Java Final
Quiz Java Final
Mark for
Review
(1) Points
The subclass (or child class) gains access to any non-private methods and variables of
the superclass (or parent class). (*)
The access specifier has been set to private.
A way of organizing the hierarchy of classes.
Extending a method from a superclass.
Incorrect. Refer to Section 7 Lesson 4.
2. Which is the most accurate description of the code reuse philosophy?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Unidentified Molding Level, the level of access permitted by the default access
specifier.
Unified Modeling Language, a standardized language for modeling systems and
structures in programming. (*)
Universal Model Light, a program that reads the brightness of any given lightbulb.
None of the above.
Correct
4. What keyword is used to inherit a superclass?
Mark for
Review
(1) Points
new
public
extends (*)
this
Correct
5. Which of the following correctly defines a superclass (or parent class)?
Mark for
Review
(1) Points
A class that inherits methods and fields from a more general class.
The most specific class of a hierarchy system of classes.
A class that passes down its methods to more specialized classes. (*)
A keyword that allows or restricts access to data and methods.
Correct
6. Which of the following correctly defines a subclass (or child class)?
Mark for
Review
(1) Points
A class that inherits methods and fields from a more general class. (*)
A keyword that allows or restricts access to data and methods.
A class that passes down its methods to more specialized classes.
The most general class of a hierarchy system.
Correct
7. Methods are generally declared as public so other classes may use them. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
8. Which of the following correctly describes the use of the keyword super?
Mark for
Review
(1) Points
Correct
9. Which of the following is the proper way to set the public variable length of the super class
equal to 5 from inside the subclass?
Mark for
Review
(1) Points
super.length() = 5
super.length(5)
super.length = 5 (*)
super(length = 5)
Correct
10What is a hierarchy?
.
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True (*)
False
Correct
13Consider creating a class Square that extends the Rectangle class provided below. Knowing
. that a square always has the same width and length, which of the following best
represents a constructor for the Square class?
Mark for
Review
(1) Points
(*)
None of the above.
Incorrect. Refer to Section 7 Lesson 4.