Quiz 8

Friday

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

  1. All classes directly or indirectly inherit from one class. What is this class’s name?

    1. Super
    2. Object
    3. Root
    4. Java
  2. Fields in an interface are ________.

    1. final
    2. static
    3. both final and static
    4. not allowed
  3. With the following inheritance hierarchy ...

    Ingeritance Example

    ... which of the following array declarations is correct for an array that is expected to hold up to 10 objects of types Shape, Rectangle, and Square?

    1. Rectangle[] array = new Rectangle[10]
    2. Shape[] array = new Rectangle[10]
    3. Shape[] array = new Shape[10]
    4. Rectangle[] array = new Shape[10]
  4. Here is an abstract method defined in a superclass:

    public abstract int sum(int[] arrary);

    Which of the following is required in a concrete subclass?

    1. public abstract int sum(int[] array) {...}
    2. public int sum(int[] array) {...}
    3. public double int sum(int[] array) {...}
    4. public int sum(long[] array) {...}
  5. What is an abstract method?

    1. An abstract method is any method in an abstract class.
    2. An abstract method is a method that cannot be inherited.
    3. An abstract method is declared with the reserved word abstract, and it does not have a method body.
    4. An abstract method is a method in the derived class that overrids a superclass method.

Student Performance and Statistics

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

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

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

Q1 0.9 / 1 Q2 0.7 / 1 Q3 0.6 / 1 Q4 0.7 / 1 Q5 0.9 / 1