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)

CS 1331 Exam 2 with accurate detailed solutions

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
13-08-2025
Written in
2025/2026

CS 1331 Exam 2 with accurate detailed solutions

Institution
CS 1331
Course
CS 1331

Content preview

CS 1331 Exam 3 with accurate |!! |!! |!! |!! |!! |!!




detailed solutions |!!




Static Type - correct answer✔✔another word for Declared Type
|!! |!! |!! |!! |!! |!! |!! |!!




Dynamic Type - correct answer✔✔another word for Object Type; the actual
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




class that follows the new operator when an Object is instantiated
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




True, fails is-a test (Dog is NOT a Poodle), produces a ClassCastException -
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




correct answer✔✔T/F: The following code produces a runtime error
|!! |!! |!! |!! |!! |!! |!! |!! |!!




Dog dg = new Dog("name", 1);
|!! |!! |!! |!! |!!




((Poodle)dg).enterDogShow();



False, you can legally (syntax) cast an object up or down its inheritance
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




tree as long as the target type has the variable or method being accessed
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




- correct answer✔✔T/F: The following code produces a compiler error
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




Dog dg = new Dog("name", 1);
|!! |!! |!! |!! |!!




((Poodle)dg).enterDogShow();



Runtime - correct answer✔✔Dynamic binding, process of matching a
|!! |!! |!! |!! |!! |!! |!! |!! |!!




method call in a statement to its actual definition, occurs at...
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




JVM - correct answer✔✔The _____ tries to find a method that can handle a
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




thrown exception |!!




Unchecked - correct answer✔✔Classes in the RuntimeException hierarchy
|!! |!! |!! |!! |!! |!! |!! |!!




(includes subclasses) are known as [checked/unchecked] exceptions
|!! |!! |!! |!! |!! |!!

, Checked - correct answer✔✔Classes outside the RuntimeException
|!! |!! |!! |!! |!! |!! |!!




hierarchy (includes subclasses) are known as [checked/unchecked]
|!! |!! |!! |!! |!! |!! |!!




exceptions



True (the code will not compile with the error: "FileNotFoundException;
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




must be caught or declared to be thrown") - correct answer✔✔T/F: You
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




cannot compile code to read a file without having a try/except catch for it.
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




Whitespace - correct answer✔✔By default, the Scanner uses ______
|!! |!! |!! |!! |!! |!! |!! |!! |!!




delimiter when tokenizing data. |!! |!! |!!




java.io - correct answer✔✔File is a class in the ______ package
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




Throwable - correct answer✔✔The Error and Exception classes are direct
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




subclasses of... |!!




False - correct answer✔✔T/F: The top of the call stack is always going to
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




be the main method.
|!! |!! |!!




First - correct answer✔✔If an exception is thrown, the JVM will execute the
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




______ catch block with a parameter type that matches the object's type.
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




True - correct answer✔✔T/F: The finally block is also executed if no
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




exceptions are thrown. |!! |!!




implementors - correct answer✔✔Classes being used by an interface are |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!




called...

Written for

Institution
CS 1331
Course
CS 1331

Document information

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

Subjects

€14,03
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.
Ruiz Liberty University
Follow You need to be logged in order to follow users or courses
Sold
102
Member since
1 year
Number of followers
1
Documents
14000
Last sold
1 week ago
Top-Quality Study Materials for Success – Ace Your Exams with Expert Resources!

Access high-quality study materials to help you excel in your exams. Get notes, summaries, and guides tailored to your courses!

3,2

15 reviews

5
4
4
4
3
2
2
1
1
4

Recently viewed by you

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

Frequently asked questions