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 following catch clause
Catch (Exception e)
Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
B
Beginning in Java 7, you can use ________ to reduce a lot of duplicated code in a try statement that needs to catch multiple exceptions, but perform the same operation for each one.
Free
(Multiple Choice)
5.0/5
(34)
Correct Answer:
A
When an object is serialized, it is converted into a series of bytes that contain the object's data.
Free
(True/False)
4.8/5
(46)
Correct Answer:
True
To write data to a binary file, you create objects from the following classes:
(Multiple Choice)
4.9/5
(38)
If a class has fields that are objects of other classes, those classes must implement the Serializable interface in order to be serialized.
(True/False)
4.7/5
(41)
A class must implement the Serializable interface in order for objects of the class to be serialized.
(True/False)
4.7/5
(31)
When using the throw statement, if you do not pass a message to the exception object's constructor,
(Multiple Choice)
4.7/5
(37)
All of the exceptions that you will handle are instances of classes that extend this class.
(Multiple Choice)
4.9/5
(32)
When an exception is thrown by code in the 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.8/5
(47)
This is a section of code that gracefully responds to exceptions when they are thrown.
(Multiple Choice)
4.8/5
(35)
What will the following code display?
String input = "99#7";
Int number;
Try
{
Number = Integer.parseInt(input);
}
Catch(NumberFormatException ex)
{
Number = 0;
}
Catch(RuntimeException ex)
{
Number = 1;
}
Catch(Exception ex)
{
Number = -1;
}
System.out.println(number);
(Multiple Choice)
4.8/5
(33)
To read data from a binary file, you create objects from the following classes:
(Multiple Choice)
4.9/5
(26)
In a try statement, the try clause must appear first, followed by all of the catch clauses, followed by the optional finally clause.
(True/False)
4.7/5
(35)
If a method does not handle a possible checked exception, what must the method have?
(Multiple Choice)
4.7/5
(30)
When catching multiple exceptions that are related to one another through inheritance, you should handle the more specialized exception classes before the more general exception classes.
(True/False)
4.8/5
(39)
In order for an object to be serialized, the class must implement this interface.
(Multiple Choice)
4.8/5
(43)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)