Services
Discover
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Illuminated
Exam 11: Exceptions, and Input Output Operations
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Multiple Choice
When is it good practice to call the close method?
Question 22
True/False
It is legal to have more than one catch block to match a try block.
Question 23
True/False
Tokens separate one delimiter from the next.
Question 24
True/False
Assuming numberStream is a Stream containing doubles, the following code is adding all the doubles in the Stream that are greater than 5.0. double sum = numberStream.mapToDouble( item -> Double.parseDouble( item ) ) .filter( price -> price > 5.0 ) .sum( );
Question 25
Essay
Tyler wrote a code that includes multiple catch blocks to catch files not found and characters that are not integers. Predict what will happen if a user enters an invalid file and also enters a 1.5 for the integer.
Question 26
Multiple Choice
When reading objects from a file, until we have reached the end of the file, the condition for the while loop inside a try block is:
Question 27
Short Answer
For an object of a class to be written to a file, that class must implement the __________ interface.
Question 28
Essay
How can the methods of the Exception class be useful?
Question 29
True/False
Code that could generate a checked exception must be coded with a try and catch block or placed inside a method that throws that exception itself.
Question 30
Multiple Choice
To handle an exception, we use a _________ construct.
Question 31
Multiple Choice
When we open a file for writing and the file already exists:
Question 32
True/False
The return value for all Scanner methods is boolean.
Question 33
True/False
Your program will work as long as it does not generate compiler errors.
Question 34
True/False
A Stream can easily be constructed from an ArrayList.
Question 35
Short Answer
The __________ class encapsulates the concept of a Uniform Resource Locator.
Question 36
Multiple Choice
Professor Simmons had a text file of students in his first-year economics class last semester. This semester, he has all new students. What action should he take to create a useful file for this semester?
Question 37
True/False
Sydney accidentally entered .5 instead of 5 in a code asking that she input an integer. She did not get a compiler error, but the program did not run because it generated an exception, which terminated the program.