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 EXAM 2 QUESTIONS AND CORRECT ANSWERS

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

ITSC 1213 EXAM 2 QUESTIONS AND CORRECT ANSWERS

Content preview

ITSC 1213 EXAM 2 QUESTIONS AND CORRECT
ANSWERS


Shirt inherits Clothing. Clothing has the fold()method, but Shirt does not. Which fold() is
executed in the following code?

Shirt myShirt = new Shirt();
myShirt.fold(); - Answers - The clothing version --> As the Shirt inherits Clothing so the
object of the Shirt class can call the method of Clothing

A bookstore is working on an on-line ordering system. For each type of published
material (books, movies, audio tapes) they need to track the id, title, author(s), date
published, and price.
Which of the following would be the best design? - Answers - Create the class
PublishedMaterial with children classes of Book, Movie, and AudioTape.

Below is the parent class Person:

public class Person { private String name = null;

public Person(String theName)
{
name = theName;
}

public String getFood()
{
return "Hamburger";
}
}

Which of the following method signatures in Student would correctly override the
getFood method in Person? - Answers - public String getFood()

Given the following class declarations and initializations in a client program, which of the
following is a correct call to method1?
public class Test1 {
public void method1(Test2 v1, Test3 v2) {
// rest of method not shown } }
public class Test2 extends Test1 { }
public class Test3 extends Test2 { }
The following initializations appear in a different class.

, Test1 t1 = new Test1();
Test2 t2 = new Test2();
Test3 t3 = new Test3(); - Answers - t3.method1(t3,t3);

The class Shirt extends the Clothing class. To make the class DressShirt inherit the
functionality of both Clothing and Shirt its class header would be: - Answers - public
class DressShirt extends Shirt

Which of the following is true regarding abstract classes or abstract methods? (Select
all that apply) - Answers - Abstract classes only become useful when they are extended.
Abstract methods must be overriden

An online store is working on an online ordering system for Books and Movies. For each
type of Published Material (books and movies) they need to track the id, title, date
published, and price. Which of the following would be the best design? - Answers -
Create the class PublishedMaterial and have Book and Movie inherit from it all the listed
attributes.

Below is the class Greeter and its method, greet:

public class Greeter{
public String greet() {
return "Hi"; }}

Which of the following are the correct way to create a subclass called MeanGreeter and
implement the overridden greet method of the child class so that it returns "Go Away"?
(Select all that apply) - Answers - class MeanGreeter extends Greeter
{
public String greet()
{
return "Go Away";
}
}

Under which of these conditions overloading a method would work (ie: the class will
contain two methods with the same name)? - Answers - The methods have different
numbers of parameters.

If you have a parent class Animal that has a method speak() which returns: Awk. Cat
has a speak method that returns: Meow. Bird does not have a speak method. Dog has a
speak method that returns: Woof. Pig does not have a speak method. Cow has a speak
method that returns: Moo. What is the output from looping through the array a created
below and asking each element to speak()?

Document information

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

Subjects

$13.99
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