1. What does it mean to inherit a class? 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. Correct 2. Which is the most accurate description of the code reuse philosophy? Mark for Review (1) Points A programming philosophy that promotes stealing your classmates' code. A programming philosophy that promotes having no concern about the security of code. A programming philosophy that promotes protecting data and hiding implementation in order to preserve the integrity of data and methods. A programming philosophy that promotes simpler, more efficient coding by using existing code for new applications
1. What does it mean to inherit a class? 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. Correct 2. Which is the most accurate description of the code reuse philosophy? Mark for Review (1) Points A programming philosophy that promotes stealing your classmates' code. A programming philosophy that promotes having no concern about the security of code. A programming philosophy that promotes protecting data and hiding implementation in order to preserve the integrity of data and methods. A programming philosophy that promotes simpler, more efficient coding by using existing code for new applications
1. What does it mean to inherit a class? 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. Correct 2. Which is the most accurate description of the code reuse philosophy? Mark for Review (1) Points A programming philosophy that promotes stealing your classmates' code. A programming philosophy that promotes having no concern about the security of code. A programming philosophy that promotes protecting data and hiding implementation in order to preserve the integrity of data and methods. A programming philosophy that promotes simpler, more efficient coding by using existing code for new applications
. at
doe
s it
me
an
to
inh
erit
a
clas
s?
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.
Correct
2. Which is the most accurate description of the code reuse philosophy?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points
new
public
extends (*)
this
Incorrect. Refer to Section 7 Lesson 4.
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
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.