Quiz 7
Wednesday
With a piece of paper, write down your name and answers to the following questions.
What keyword in the class header indicates that a class inherits from another class?
derives
specializes
inherits
extends
In a subclass constructor, a call to the superclass constructor ________
- may appear but only as the very first statement.
- may appear but only as the very last statement.
- may not appear.
- may appear, and the position does not matter.
Two methods in the same class share the same method name. This ________
- is an example of method overloading.
- is an example of method overriding.
- is an example of method composition.
- generates a compiler error.
Which one of the following is the explicit call to the superclass’s default constructor?
default()
class()
super()
base()
Find and correct the error in the following program.