True/False Indicate whether the
statement is true or false.
|
|
|
1.
|
The ability to use inheritance in Java makes programs easier to write, less
error prone, and easier to understand.
|
|
|
2.
|
Java does not support inheritance.
|
|
|
3.
|
The parent class in the following is MyClass1.
public MyClass1 extends MyClass2 {...}
|
|
|
4.
|
The HourlyEmployee class will automatically receive the data fields and methods
of the superclass Employee.
|
|
|
5.
|
New fields and methods cannot be added to a child class.
|
|
|
6.
|
Inheritance is a one-way proposition; a child inherits from a parent, not the
other way around.
|
|
|
7.
|
When you create a class and do not provide a constructor, Java automatically
supplies you with one that never requires arguments.
|
|
|
8.
|
When you create a class with one constructor, you can still use the one
automatically created by Java.
|
|
|
9.
|
Data field definitions can precede the super() statement in the subclass
constructor.
|
|
|
10.
|
Normally, you make data private and you provide get and set methods to access
the data.
|
|
|
11.
|
A child class inherits the private members of the parent class.
|
|
|
12.
|
A static method is unique to the base class and all its descendants.
|
|
|
13.
|
In general, a subclass is larger than a superclass.
|
|
|
14.
|
Constructors are not members and are not inherited by subclasses.
|
|
|
15.
|
Subclasses inherit those superclass members declared as private or
static.
|
|
|
16.
|
In general, a subclass is larger than a superclass.
|
|
|
17.
|
Inheritance is a two-way proposition: a child inherits from a parent and a
parent inherits from a child.
|
|
|
18.
|
Parent class member methods override child class members with the same
signature.
|
|
|
19.
|
When you instantiate a member of a subclass, you call at least two
constructors.
|
|
|
20.
|
Normally, you make data private and you provide public get and set methods to
access the data.
|
Modified True/False Indicate
whether the statement is true or false. If false, change the identified word or phrase to make the
statement true.
|
|
|
21.
|
A class that is used as a basis for inheritance is called a(n) derived
class. ____________________
|
|
|
22.
|
When you create any subclass object, the superclass constructor must
execute first. ____________________
|
|
|
23.
|
Public methods in the parent class cannot be overridden in the child
class. ____________________
|
|
|
24.
|
The main() methods in Java applications are always dynamic.
____________________
|
|
|
25.
|
A subclass is a class that extends another class.
____________________
|
|
|
26.
|
Child classes does not inherit constructors from parent classes.
____________________
|
|
|
27.
|
One of the important benefits of inheritance is reusability.
____________________
|
|
|
28.
|
In order to decide which class is the parent and which one is the child, you can
use the has-a relationship. ____________________
|
|
|
29.
|
You have two classes: ClassA and ClassB. ClassB inherits from ClassA. Generally
speaking, ClassA is bigger in size. ____________________
|
|
|
30.
|
If you have a method in the parent class that you want to modify its behavior in
the child class, you say you are overloading the method. ____________________
|
|
|
31.
|
The word polymorphism means "many forms".
____________________
|
|
|
32.
|
Many methods with the same name but different argument lists, in the same class,
illustrate an example of overriding. ____________________
|
|
|
33.
|
Only comments can be placed before super() in the subclass constructor.
____________________
|
|
|
34.
|
You have two classes: ClassA and ClassB. ClassB inherits from ClassA. Both
classes have a method called printMe(). If you need to call ClassA's printMe() from
ClassB's constructor, you would use this syntax: super.printMe().
____________________
|