Java Chapter 10

Ace your homework & exams now with Quizwiz!

Binary File

A file that contains raw binary data is known as a____. The content of a____ is not formatted as text and not meant to be opened in a text editor. (page 712)

Polymorphism

A reference variable of a superclass type can reference objects that inherit from that superclass. This is called____. (page 690)

Catch Clause

A____begins with the key word catch, followed by the code(ExceptionType ParameterName). (page 684)

Random Access File

A____is a file that allows a program to read data from any location within the file, or write data to any location within the file. (page 712)

Try Block

A____is one or more statements that are executed and can potentially throw an exception. You can think of code in a____as being "Protected" because the application will not halt if the____throws an exception. (page 684)

FileNotFoundException

A____is thrown when an application tries to open a file that does not exist. (page 683)

printStackTrace

All exception objects have a____method, inherited from the Throwable class, that prints a stack trace. (page 700)

Exception Handler

An____is a section of code that gracefully responds to exceptions when they are thrown. (page 682)

Exception

An____is an object that is generated as the result of an error or an unexpected event. (page 681)

EOFException

An____object is thrown when an application attempts to read beyond the end of a file. (page 683)

getMessage

Each exception object has a method named____that can be used to retrieve the default error message for the exception. This is the same message that is displayed when the exception is not handled and the application halts. (page 688)

Default Exception Handler

IF your code does not handle an exception when it is thrown, the____deals with it. The____prints an error message and crashes the program. (page 682)

Input MismatchException

The Scanner class's nextDouble can throw an____if it reads a nonnumeric value from a file. (page 690)

multi-catch

The ability to catch multiple types of exceptions with a single catch clause is known as____and was introduced in Java7. (page 701)

Catch Block

The code that immediately follows the catch clause is known as the____. (page684)

NumberFormatException

The numeric wrapper classes' "parse" methods all throw an exception of the____type if the string being converted does not contain a convertible numeric value. (page 689)

Exception Handling

The process of intercepting and responding to exceptions is called____. (page 682)

Finally Clause

The try statement may have an optional____, which must appear after all of the catch clauses. (page 697)

Stack Trace

The____is a list of all the methods in the call stack. It indicates the method that was executing when an exception occurred and all the methods that were called in order to execute that method. (page 699)

Call Stack

The____is an internal list of all the methods that are currently executing. (page 699)

Finally Block

The____is one or more statements that are always executed after the try block has executed and after any catch blocks have executed if an exception was thrown. (page 698)

Throw

The____statement causes an exception object to be created and thrown. (page 704)

writeUTF

To write a string to a binary file, you should use the DataOutputStream class's____method. This method writes its String argument in a format knows as UTF-8 encoding. (page 717)

Unicode Test Format

UTF stands for____. (page 717)

Thrown

When an exception is generated, it is said to have been____. (page 682)

FileInputStream

____allows you to open a file for reading binary data and establish a connection with it. It provides only the basic functionality for reading bytes from a file however. (page 715)

FileOutputStream

____allows you to open a file for writing binary data and establish a connection with it. It provides only basic functionality for writing bytes to the file however. (page 713)

DataInputStream

____allows you to read the data of any primitive type, or String objects, from a binary file. The____class by itself cannot directly access a file, however. It is used in conjunction with a FileInputStream object that has a connection to a file. (page 715)

DataOutputStream

____allows you to write data of any primitive type or String objects to a binary file. The____class by itself cannot directly access a file, however. It is used in conjunction with a FileOutputStream object that has a connection to a file. (page 713)

Checked Exceptions

____are the exceptions that you should handle in your program. If the code in a method can potentially throw a____, then that method must meet one of the following requirements: It must handle the exception, or it must have a throws clause listed in the method header. (page 703)

Unchecked Exceptions

____are those that inherit from the Error class or the RuntimeException class. Exception that inherit from Error are thrown when a critical error occurs, such as running out of memory. You should not handle these exceptions. (page 703)

Object Serialization

____is the process of converting an object to a series of bytes and saving them to a file. (page 712)

Deserialization

____is the process of reconstructing a serialized object. (page 712)


Related study sets

Transportation security exam 2 (AVIATION)

View Set