already passed 2025
1. A class declared as final cannot be used as a basis for True.
inheritance.
A method declared as
fi- nal cannot be over-
ridden during
inheritance, while a
class declared as
final cannot be
extended at all.
2. All Java classes are subclasses of the class. Object
Even if you are not
us- ing inheritance,
Java acts like you
coded public class
Test extends Object
{
3. An abstract class must contain abstract methods. False
A class can be
declared as abstract to
disallow in-
stantiation even though
all its methods are
complete.
4. In Java, subclass can only extend one parent class. True
Java only supports
single inheritance
,COMP1231 - Computer Programming II Quizzes and answers
already passed 2025
5. The original class that is used to derive a A parent class | a
new class using inheritance is called . super- class | a base
class
The general case is
called a parent, base,
or super, while the
specific case is
,COMP1231 - Computer Programming II Quizzes and answers
already passed 2025
called a child, derived, or
sub.
6. Of the classes below, the one that is most Animal
likely to be declared abstract is .
a. Bat The higher a class is in
b. Squirrel a UML inheritance tree,
c. Animal the more likely it is to
d. Iguana be ab- stract.
e. Parrot
7. When a variable is declared in a subclass and Shadow
has the same name as a variable declared in a
superclass, it is called a variable. A shadow variable
will have the context
in the subclass, but
not the con- tent that
should have been
present from the
super- class.
8. In order for derived classes to have access to
encap- sulated data members and methods of Protected
superclasses, the data members and
Protected makes the
methods should be declared using the
el- ement available to
modifier.
child classes, but it
would act as private
outside of the par- ent
and child classes.
9. The special reference is used to refer to the Super
parent class in a child class.
Use the reference
, COMP1231 - Computer Programming II Quizzes and answers
already passed 2025
super to refer to
something in