Quiz 6 on 04 February 2004
01) Which of the following statements are true? Select all valid answers.
a) In Java, the extends clause is used to specify inheritance.
b) The subclass of a non-abstract class can be declared abstract.
c) All the members of the superclass are inherited by the subclass.
d) a final class can be abstract.
e) A class, in which all the members are declared private, cannot be
declared public.
02) Which of the following statements are true? Select all valid answers.
a) Inheritance defines a has-a relationship between a superclass and its
subclasses.
b) Every Java object has a method named equals().
c) Every Java object has a method named length().
d) A class can extend any number of other classes.
e) A non-final class can be extended by any number of classes.
03) Which of the following statements are true? Select all valid answers.
a) Subclasses must define all the methods that the superclass defines.
b) It is possible for a subclass to define a method with the same name
and parameters as a method that the superclass defines.
c) It is possible for a subclass to define a member variable with the same
name as a member variable that the superclass defines.
d) It is possible for two classes to be the superclass of each other.