Quiz 8
Wednesday
With a piece of paper, write down your name and answers to the following questions.
When a concrete class implements an interface, it must ________.
- overload all of the methods listed in the interface
- override all of the methods listed in the interface
- not have any constructors
- not have any fields
Abstract classes can ________.
- be used as superclasses
- be used as subclasses
- have instance fields
- All of the above
With the following inheritance hierarchy ...
... 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?
shape = triangle
shape = square
square = null
square = rectangle
What is an abstract class?
- An abstract class is one without any derived classes.
- An abstract class is any superclass with more than one subclass.
- An abstract class is a class that contains abstract methods.
- An abstract class is another name for “base class.”
What must be true if a derived class of an abstract superclass does not override all of the superclass’s abstract methods?
- This is always an error on the subclass.
- This is always an error on the superclass.
- The derived class itself must be declared abstract.
- 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.
A table showing the average performance for each question in Quiz 8 on Wednesday.