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
Exam (elaborations)

ITSC 1213 - TEST 3 QUESTIONS AND CORRECT ANSWERS

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
23-07-2026
Written in
2025/2026

ITSC 1213 - TEST 3 QUESTIONS AND CORRECT ANSWERS

Content preview

ITSC 1213 - TEST 3 QUESTIONS AND CORRECT
ANSWERS


If a java class named Dog inherits a class named Animal then - Answers - Animal is the
superclass and Dog is the subclass

What is the proper class header for Dog if Dog inherits Animal? - Answers - public void
Dog() extends Animal

If you want a class called Collie to inherit both Dog and Animal, how should the headers
of three classes appear? - Answers - public void Animal()
public void Dog() extends Animal
public void Collie() extends Dog

You define a class, Animal, and create an object of Animal, pantherObject. You do not
include a toString() method in Animal. Would the following code compile and execute
normally:

pantherObject.toString(); - Answers - Yes. Because Animal inherits the Java class,
Object. Object includes a toString() method which is automatically inherited by your
class, Animal.

If Dog inherits Animal, Dog has direct access to the ___________________ members
of Animal. - Answers - public

Dog inherits Animal. Animal has a private field named dietField and a public
getter/setter method pair to access dietField. How may Dog access dietField? -
Answers - Dog inherits the public getter/setter methods. It may access dietField through
these methods.

Dog inherits Animal. Dog has a public method getBreed(). Animal does not have a
getBreed() method. What access does Animal have to the getBreed() method that is in
Dog? - Answers - Even though getBreed() is public, Animal has NO access because
Dog inherits Animal, but Animal does not inherit Dog.

or

Only Dog objects created within the Animal class can call the getBreed() method

If Dog inherits Animal, what is the first thing that must happen within the Dog
constructor when a Dog object is created? Assume Animal does not have a default
constructor. - Answers - Call the Animal constructor

, Dog inherits Animal. Animal has only one constructor, and it requires a single String
parameter. In the Dog constructor, how is the Animal constructor called? - Answers -
super(<String_parameter>);

Dog inherits Animal. Some methods of Dog may have the same name as methods of
Animal. If you create a Dog object and and call one of these methods, which version of
the method gets control (i.e. is executed)? - Answers - If the methods have identical
signatures, control is passed to the Dog version of the method.

or

If the methods have identical signatures, control is passed to the Animal method.

Which of the following are valid data types for fields of a class? - Answers - Turtle
String
int
double

Which of the data types below would be considered aggregation if you used them to
define fields in a given class. - Answers - Double
String
Integer
Turtle

You have a fully defined class named Author. Author has a default constructor. You are
defining a new class, Book. One of the fields of Book is an Author object reference
variable. When must you call the Author constructor? - Answers - It is called
automatically when you instantiate the Author object within Book.

A class named Actor extends class Movie and both classes have a method called
getName() that contains different code. An actor object tomCruise and a movie object
missionImpossible have been created. Assume tomCruise gets assigned to
missionImpossible
(i.e. missionImpossible = tomCruise) and we call missionImpossible.getName(), the
code inside of the getName() method in the Actor class will be executed.

To get a polymorphic operation as described above, which of the following must be true.
- Answers - The getName() method must be a member of the subclass: Actor

The getName() method must be a member in the superclass: Movie

The superclass and subclass method return types must be the same.

The superclass and subclass method signatures must be the same

Document information

Uploaded on
July 23, 2026
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$13.49
Get access to the full document:

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

Get to know the seller

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.
QUEENS Harvard University
View profile
Follow You need to be logged in order to follow users or courses
Sold
228
Member since
4 year
Number of followers
180
Documents
4767
Last sold
5 days ago

4.1

61 reviews

5
35
4
10
3
8
2
3
1
5

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