Exam 10: Exceptions and Advanced File Io
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 Structures42 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 Io40 Questions
Exam 11: Java-Fx: Gui Programming and Basic Controls40 Questions
Exam 12: Java-Fx: Advanced Controls40 Questions
Exam 13: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 14: Recursion24 Questions
Exam 15: Databases40 Questions
Select questions type
If a method does not handle a possible checked exception, what must the method have?
Free
(Multiple Choice)
4.8/5
(28)
Correct Answer:
D
In a try statement, the try clause must appear first, followed by all of the catch clauses, followed by the optional finally clause.
Free
(True/False)
4.9/5
(36)
Correct Answer:
True
To read data from a binary file, you create objects from which of the following classes?
(Multiple Choice)
4.8/5
(40)
The call stack is an internal list of all the methods that are currently executing.
(True/False)
4.7/5
(46)
The ability to catch multiple types of exceptions with a single catch clause is known as multi-catch and was introduced in Java7.
(True/False)
4.9/5
(33)
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
(41)
When you write a method that throws a checked exception, you must
(Multiple Choice)
4.8/5
(31)
Beginning with Java7, you can use __________ to reduce a lot of duplicated code in a try statement needs to catch multiple exceptions, but performs the same operation for each one.
(Multiple Choice)
4.8/5
(36)
A(n) __________ is a section of code that gracefully responds to exceptions when they are thrown.
(Multiple Choice)
4.9/5
(35)
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.7/5
(43)
Which of the statements below give an alternative way to write the following: FileInputStream fstream = new FileInputStream("info.dat");
DataInputStream inputFile = new DataInputStream(fstream);
(Multiple Choice)
4.8/5
(44)
When an exception is thrown by code in its try block, the JVM begins searching the try statement for a catch clause that can handle it and passes control of the program to
(Multiple Choice)
4.9/5
(37)
What happens if a program does not handle an unchecked exception?
(Multiple Choice)
4.9/5
(29)
All of the exceptions that you will handle are instances of classes that extend the __________ class.
(Multiple Choice)
4.9/5
(40)
When catching multiple exceptions that are related to one another through inheritance you should handle the more general exception classes before the more specialized exception classes.
(True/False)
4.8/5
(41)
A(n) __________ contains one or more statements that are executed and can potentially throw an exception.
(Multiple Choice)
4.8/5
(42)
When you deserialize an object using the readObject method, you must cast the return value to the desired class type.
(True/False)
4.8/5
(38)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)