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)

CS160 Midterm 2 review questions with correct answers

Rating
-
Sold
-
Pages
15
Grade
A+
Uploaded on
17-05-2026
Written in
2025/2026

CS160 Midterm 2 review questions with correct answers

Institution
CS160
Course
CS160

Content preview

CS160 Midterm 2 review questions with
correct answers

Select the statement in main to assign a command-line argument to String
| | | | | | | | | | | |


lastName. |




| java Player Manny Machado 13 Infielder
| | | | |




A) lastName = "Machado";
| | |




C) lastName = args;
| | |




B) lastName = args[1];
| | |




D) lastName = args|3]; - CORRECT ANSWER✔✔-B
| | | | | |




A(n) ________ is an unexpected incident that stops the normal execution of a
| | | | | | | | | | | | |


program. |




A) exception
|




C) default exception handler
| | |




is an unexpected incident that stops the normal execution of a program.
| | | | | | | | | | |




B) error message
| |




D) exception handler - CORRECT ANSWER✔✔-A
| | | | |




What is output given the user input below?
| | | | | | |




| ›thorin fili kili | |




| System.out.print ("Enter info: "); | | |

, | Scanner keyboard = new Scanner(System.in);
| | | |




| String info = keyboard.nextLine();
| | |




| Scanner inputScnr = new Scanner(info);
| | | |




| int item1 = inputScnr.nextInt();
| | |




| String item = inputScnr.next();
| | |




| String item3 = inputScnr.next();
| | |




| System.out.printIn(item2 + " " + item2 + " " + item1); | | | | | | | | | |




A) kili fili thorin
| | |




B) thorin fili kili
| | |




C) thorin thorin thorin
| | |




D) InputMismatchException - CORRECT ANSWER✔✔-D
| | | |




You can use this method to determine whether a file exists.
| | | | | | | | | |




A) The File class's canOpen method
| | | | |




B) The File class's exists method
| | | | |




C) The Scanner class's exists method
| | | | |




D) The PrintWriter class's fileExists method - CORRECT ANSWER✔✔-B
| | | | | | | |




The call stack is an internal list of all the methods that are currently executing.
| | | | | | | | | | | | | | |


True or false? - CORRECT ANSWER✔✔-True
| | | | |




The automatic conversion of an int type to the corresponding wrapper type
| | | | | | | | | | | |


Integer when being passed as a parameter to a generic class is called
| | | | | | | | | | | |

Written for

Institution
CS160
Course
CS160

Document information

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

Subjects

$14.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.
Lectphilip West Virginia University
Follow You need to be logged in order to follow users or courses
Sold
263
Member since
2 year
Number of followers
6
Documents
24135
Last sold
3 days ago
WELCOME TO LECTPHILIP, A PLACE WHERE WE UNLOCK YOUR ACADEMIC OPPORTUNITIES

On this page, you find all documents, package deals and flashcards offered by seller lectphilip

4.0

41 reviews

5
20
4
8
3
9
2
2
1
2

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