Quiz 7


With a piece of paper, write down your name and answers to the following questions.

  1. What keyword in the class header indicates that a class inherits from another class?

    1. derives
    2. specializes
    3. inherits
    4. extends
  2. In a subclass constructor, a call to the superclass constructor ________

    1. may appear but only as the very first statement.
    2. may appear but only as the very last statement.
    3. may not appear.
    4. may appear, and the position does not matter.
  3. Two methods in the same class share the same method name. This ________

    1. is an example of method overloading.
    2. is an example of method overriding.
    3. is an example of method composition.
    4. generates a compiler error.
  4. Which one of the following is the explicit call to the superclass’s default constructor?

    1. default()
    2. class()
    3. super()
    4. base()
  5. Find and correct the error in the following program.