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
When using the throw statement, if you don't pass a message to the exception object's constructor,
(Multiple Choice)
4.9/5
(45)
An exception object's default error message can be retrieved using the __________ method.
(Multiple Choice)
4.9/5
(35)
In a catch statement, what does the following code do? System.out.println(e.getMessage());
(Multiple Choice)
4.8/5
(40)
Classes that inherit from the Error class are for exceptions that are thrown when
(Multiple Choice)
4.8/5
(34)
To write data to a binary file, you create objects from which of the following classes?
(Multiple Choice)
4.8/5
(34)
A(n) __________ is an object that is generated in memory as the result of an error or an unexpected event.
(Multiple Choice)
4.9/5
(37)
The throw statement informs the compiler that a method throws one or more exceptions.
(True/False)
4.8/5
(40)
A class must implement the Serializable interface in order for the objects of the class to be serialized.
(True/False)
4.9/5
(41)
To serialize an object and write it to the file, use the __________ method of the ObjectOutputStream class.
(Multiple Choice)
4.9/5
(26)
When an object is serialized, it is converted into a series of bytes that contain the object's data.
(True/False)
4.9/5
(40)
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
(37)
If a class has fields that are objects of other classes, those classes do not need to implement the Serializable interface to be serialized.
(True/False)
4.8/5
(34)
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)
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.8/5
(39)
In order for an object to be serialized, the class must implement the __________ interface.
(Multiple Choice)
4.8/5
(42)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)