Exam 10: Exceptions and Advanced File I/O

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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)

The catch clause

(Multiple Choice)
4.9/5
(40)

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)

The RandomAccessFile class treats a file as a stream of

(Multiple Choice)
4.8/5
(45)

Classes that inherit from the Error class are

(Multiple Choice)
4.9/5
(33)

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)

A file that contains raw binary data is known as a(n)

(Multiple Choice)
4.8/5
(32)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)