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 3 out of 17 pages
Exam (elaborations)

COMP 1231 QUIZZES AND ANSWERS VERIFIED TO PASS 2025

Document preview thumbnail
Preview 3 out of 17 pages

COMP 1231 QUIZZES AND ANSWERS VERIFIED TO PASS 2025

Content preview

COMP 1231 QUIZZES AND ANSWERS VERIFIED TO PASS 2025

1. A child class is not allowed to
False
define a method with the same
name and pa- rameter list as a Having a method with the same name
method in the parent class. and para- meter list is called "over-riding"
and is a common practice for inheritance,
Question 1
e.g. see message() for the Thought and
Select one: True or False
Advice classes.
2. Of the classes below, the one
that is most likely to be
Animal
declared abstract is
. The higher a class is in a UML inheritance
tree, the more likely it is to be abstract.
Question 2
Select one:
a. Bat
b. Squirrel
c. Animal
d. Iguana
e. Parrot

3. In Java, subclass can only extend True
one parent class.
Java only supports single inheritance.
Question 3
Select one: True or False

4. In order for derived classes to
protected
have access to encapsulated data
members
and methods of superclasses, the data Protected makes the element available
to child
members and methods should be de- clared using the
1/
17

,COMP 1231 QUIZZES AND ANSWERS VERIFIED TO PASS 2025

modifier. classes, but it would act as private outside of
the parent and child classes.
Question 4




2/
17

, COMP 1231 QUIZZES AND ANSWERS VERIFIED TO PASS 2025

Select one:
a. private
b. public
c. protected
d. final
e. static

5. A class declared as final cannot be used True
as a basis for inheritance.
A method declared as final cannot be over-
Question 5 ridden during inheritance, while a class
Select one: True or False declared as final cannot be extended at all.
6. When a variable is declared in a shadow
sub- class and has the same
name as a vari-
able declared in a superclass, it is called A shadow variable will have the
context in the sub-
a variable. Select
one:
Question 6 a. super
Select one:
a. final
b. shadow
c. static
d. dead
e. This is not allowed in Java.

7. Which of the following key words
indi- cates a new class is being
derived from an existing class?

Question 7
3/
17

Document information

Uploaded on
August 13, 2025
Number of pages
17
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
7346
Last sold
6 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