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 2 out of 13 pages
Exam (elaborations)

CS 2114 Final Review Exam Questions With Complete Answers

Document preview thumbnail
Preview 2 out of 13 pages

CS 2114 Final Review Exam Questions With Complete Answers...

Content preview

CS 2114 Final Review Exam Questions With
Complete Answers

When do you use an interface? - ANSWER when several classes have the same
method signatures but implement all
the methods differently

When do you use an abstract class? - ANSWER when several classes have
identical methods and a few methods that need
to be implemented differently

Where does a queue add new items? - ANSWER at the back

The node that is easiest to access in a linked chain is - ANSWER the head node

In the Ch 6 linked chain implementation of a Stack ADT, the performance of
popping an entry from the stack is - ANSWER O(1)

In the Ch 6 linked chain implementation of a Stack ADT, when a node is popped
from the stack - ANSWER (1) the original first node will no longer be referenced
(2) the original first node will be deallocated
(3) the first node will reference what was second node in the chain

when an interface is used as a data type what methods can you invoke? -
ANSWER only methods of the interface

TRUE or FALSE... Several classes can implement the same interface - ANSWER
TRUE

TRUE or FALSE... One class can implement several interfaces - ANSWER TRUE

Recursive methods need - ANSWER a base case

In the Ch 6 array based implementation of a Stack ADT, what value for the
topIndex of the stack indicates that it is empty? - ANSWER -1

In the Ch 6 array-based implementation of a Stack ADT, the entry peek returns
what is be found at - ANSWER the last occupied location in the array

Polymorphism is when the type of the instance is determined at - ANSWER
runtime

, At _______ the variable type is checked to make sure the methods invoked
exist - ANSWER compile time

At _______ the JVM looks at the object's type to determine which method
implementation to call - ANSWER runtime

What does a primitive type represent? - ANSWER Simple indecomposable type

What does a reference type represent? - ANSWER A memory address instead of
the actual item stored at that address

The operator == tests to see if - ANSWER Two variables reference the same
place in the computer's memory

A class uses composition when it - ANSWER Declares an instance of another
class as a data field

Composition - ANSWER has-a relationship

inheritance - ANSWER is-a relationship

Why do we use inheritance? - ANSWER To have a general class with common
properties and behaviors shared by multiple more specialized classes.

calls the constructor of the parent class that takes no arguments - ANSWER
super();

calls the constructor of the current class that takes no arguments - ANSWER
this();

when one method has the same name but a different set of parameters than a
second method - ANSWER the methods are overloaded

a key benefit of inheritance is - ANSWER an object can have several types, it is
type compatible with any of its superclasses

encapsulation - ANSWER design principle that encloses data and methods
within a class, thereby hiding the class' implementation details

abstraction - ANSWER focus on what and not how

client interface - ANSWER what client code needs to know to use a class

implementation - ANSWER all the data fields and details of the method
definitions

Document information

Uploaded on
May 15, 2026
Number of pages
13
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$18.49

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.
Zayla
3.4
(18)
Sold
130
Followers
13
Items
16587
Last sold
8 hours 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