Starting Out with Java Study Set 1

Computing

Quiz 10 :

Inheritance

Quiz 10 :

Inheritance

Question Type
search
arrow
You can write a super statement that calls a superclass constructor but only in the subclass's constructor.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
Because every class directly or indirectly inherits from the Object class, every class inherits the Object class's members.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
An abstract class is not instantiated itself but serves as a superclass for other classes.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
A(n) __________ method is a method that appears in a superclass but expects to be overridden in a subclass.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
A functional interface is simply an interface that has one abstract method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If a subclass constructor does not explicitly call a superclass constructor, __________.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
In Java, a reference variable is __________ because it can reference objects of types different from its own, as long as those types are related to its type through inheritance.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
When a subclass extends a superclass, the public members of the superclass become public members of the subclass.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Inheritance involves a subclass, which is the general class, and a superclass, which is the specialized class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A __________ member's access is somewhere between public and private.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
Which of the following shows the inheritance relationships among classes in a manner similar to that of a family tree?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
In an inheritance relationship, the subclass constructor always executes before the superclass constructor.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If two methods in the same class have the same name but different signatures, the second overrides the first.
True False
Answer:
Tags
Choose question tag
close menu
arrow
It is not possible for a superclass to call a subclass's method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
When a subclass overrides a superclass method, only the subclass's version of the method can be called with a subclass object.
True False
Answer:
Tags
Choose question tag
close menu
arrow
All methods in an abstract class must also be declared abstract.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Every class has a toString method and an equals method inherited from the Object class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Because the subclass is more specialized than the superclass, it is sometimes necessary for the subclass to replace inadequate superclass methods with more suitable ones.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A compiler error will result if an anonymous inner class tries to use a variable that is not final, or not effectively final.
True False
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 64