Exam 10: Exceptions and Advanced File I/O

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

The following catch clause Catch (Exception e)

Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
Verified

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:
Verified

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:
Verified

True

When an exception is thrown,

(Multiple Choice)
4.7/5
(33)

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)

In Java, there are two categories of exceptions:

(Multiple Choice)
4.7/5
(37)

This is a section of code that gracefully responds to exceptions when they are thrown.

(Multiple Choice)
4.8/5
(35)

The throws clause causes an exception to be thrown.

(True/False)
4.7/5
(37)

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)

Unchecked exceptions are those that inherit from the

(Multiple Choice)
4.7/5
(39)

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

Filters

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