Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 53 pages
Exam (elaborations)

COMP1231 - Computer Programming II Quizzes and answers already passed 2025

Document preview thumbnail
Preview 4 out of 53 pages

COMP1231 - Computer Programming II Quizzes and answers already passed 2025

Content preview

COMP1231 - Computer Programming II Quizzes and answers
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

Document information

Uploaded on
August 13, 2025
Number of pages
53
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$17.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
LEWISSHAWN55
2.9
(11)
Sold
96
Followers
46
Items
7339
Last sold
2 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions