Quiz 8

Wednesday

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

  1. When a concrete class implements an interface, it must ________.

    1. overload all of the methods listed in the interface
    2. override all of the methods listed in the interface
    3. not have any constructors
    4. not have any fields
  2. Abstract classes can ________.

    1. be used as superclasses
    2. be used as subclasses
    3. have instance fields
    4. All of the above
  3. With the following inheritance hierarchy ...

    Ingeritance Example

    ... and the following variable declarations ...

    Shape     shape     = new Shape();
    Triangle  triangle  = new Triangle();
    Rectangle rectangle = new Rectangle();
    Square    square    = new Square();

    ... which one of the following will cause a compiler error?

    1. shape = triangle
    2. shape = square
    3. square = null
    4. square = rectangle
  4. What is an abstract class?

    1. An abstract class is one without any derived classes.
    2. An abstract class is any superclass with more than one subclass.
    3. An abstract class is a class that contains abstract methods.
    4. An abstract class is another name for “base class.”
  5. What must be true if a derived class of an abstract superclass does not override all of the superclass’s abstract methods?

    1. This is always an error on the subclass.
    2. This is always an error on the superclass.
    3. The derived class itself must be declared abstract.
    4. The derived class is automatically non-abstract, and this is OK.

Student Performance and Statistics

A histogram of student performance on percentage grades for Quiz 8 on Wednesday.

100% 0 90 - 99% 0 80 - 89% 7 70 - 79% 0 60 - 69% 4 50 - 59% 0 40 - 49% 2 30 - 39% 2 20 - 29% 1 10 - 19% 0 0 - 9% 1

A table showing the average performance for each question in Quiz 8 on Wednesday.

Q1 0.9 / 1 Q2 0.3 / 1 Q3 0.7 / 1 Q4 0.7 / 1 Q5 0.2 / 1