Exam 10: Exceptions and Advanced File I/O
Exam 1: Introduction to Computers and Java40 Questions
Exam 2: Java Fundamentals40 Questions
Exam 3: A First Look at Classes and Objects40 Questions
Exam 4: Decision Structures40 Questions
Exam 5: Loops and Files40 Questions
Exam 6: A Second Look at Classes and Objects40 Questions
Exam 7: Arrays and the ArrayList Class40 Questions
Exam 8: Text Processing and Wrapper Classes40 Questions
Exam 9: Inheritance40 Questions
Exam 10: Exceptions and Advanced File I/O40 Questions
Exam 11: GUI Applications–Part 140 Questions
Exam 12: GUI Applications–Part 240 Questions
Exam 13: Applets and More40 Questions
Exam 14: Creating GUI Applications with JavaFX40 Questions
Exam 15: Recursion20 Questions
Exam 16: Databases40 Questions
Select questions type
The call stack is an internal list of all the methods that are currently executing.
(True/False)
4.8/5
(39)
If a program does not handle an unchecked exception, what is the result?
(Multiple Choice)
4.8/5
(36)
In a catch statement, what does the following code do?
System.out.println(e.getMessage());
(Multiple Choice)
4.8/5
(37)
To serialize an object and write it to the file, use this method of the ObjectOutputStream class.
(Multiple Choice)
4.9/5
(38)
An exception object's default error message can be retrieved using this method.
(Multiple Choice)
5.0/5
(33)
What will be the result of the following statements?
FileInputStream fstream = new FileInputStream("Input.dat"); DataInputStream inFile = new DataInputStream(fstream);
(Multiple Choice)
4.9/5
(37)
A(n) ________ is one or more statements that are executed and can potentially throw an exception.
(Multiple Choice)
4.9/5
(42)
The throw statement informs the compiler that a method throws one or more exception.
(True/False)
4.8/5
(41)
When you write a method that throws a checked exception, you must
(Multiple Choice)
4.9/5
(31)
When you deserialize an object using the readObject method, you must cast the return value to the desired class type.
(True/False)
4.7/5
(29)
Look at the following code:
FileInputStream fstream = new FileInputStream("info.dat"); DataInputStream inputFile = new DataInputStream(fstream);
This code could also be written as
(Multiple Choice)
4.9/5
(38)
If a random access file contains a stream of characters, which of the following statements would move the file pointer to the starting byte of the fifth character in the file?
(Multiple Choice)
4.8/5
(33)
A(n) ________ is an object that is generated in memory as the result of an error or an unexpected event.
(Multiple Choice)
4.8/5
(39)
When writing a string to a binary file or reading a string from a binary file, it is recommended that you use
(Multiple Choice)
4.7/5
(37)
If the data.dat file does not exist, what will happen when the following statement is executed?
RandomAccessFile randomFile = new RandomAccessFile("data.dat", "rw");
(Multiple Choice)
4.9/5
(35)
The ability to catch multiple types of exceptions with a single catch clause is known as multi-catch, and was introduced in Java 7.
(True/False)
4.9/5
(33)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)