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.9/5
(75)

If a program does not handle an unchecked exception, what is the result?

(Multiple Choice)
4.8/5
(74)

In a catch statement, what does the following code do? System.out.println(e.getMessage());

(Multiple Choice)
4.9/5
(72)

The catch clause

(Multiple Choice)
4.9/5
(76)

To serialize an object and write it to the file, use this method of the ObjectOutputStream class.

(Multiple Choice)
4.9/5
(89)

An exception object's default error message can be retrieved using this method.

(Multiple Choice)
5.0/5
(76)

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
(82)

A(n) ________ is one or more statements that are executed and can potentially throw an exception.

(Multiple Choice)
4.9/5
(82)

The throw statement informs the compiler that a method throws one or more exception.

(True/False)
4.8/5
(82)

When you write a method that throws a checked exception, you must

(Multiple Choice)
4.9/5
(75)

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
(67)

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
(81)

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
(80)

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
(78)

The RandomAccessFile class treats a file as a stream of

(Multiple Choice)
4.8/5
(79)

Classes that inherit from the Error class are

(Multiple Choice)
5.0/5
(71)

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
(71)

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

(Multiple Choice)
4.8/5
(77)

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
(69)

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)
5.0/5
(78)
Showing 21 - 40 of 40
close modal

Filters

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