Java

Ace your homework & exams now with Quizwiz!

checked

A ..... exception is one that must be either caught and handled in a method or declared in a throws clause for the method.

an object

An Exception (as distinct from an exception) is:

error

An Exception-like class that represents conditions from which there is generally no reliable recovery is the ... class?

a circumstance that a programmer chooses to handle outside the code that handles "normal cases

An exception (as distinct from an Exception) is:

super.toWrite(var);

How would you call the method "toWrite" in the superclass? Assume toWrite takes an integer, which you've defined as "var"

super.toWrite();

How would you call the method "toWrite" in the superclass? Assume toWrite takes no parameters.

unchecked

The RunTimeException class is the ancestor class of all ..... exceptions.

recognize an exception, create an Exception, throw the Exception, detect the Exception, handle the exception

The five steps in exception processing (in order) at run-time are:

False. A subclass is not a subset of its superclass. In fact, a subclass usually contains more information and methods than its superclass.

True or False? A subclass is a subset of a superclass.

True

True or False? When invoking a constructor from a subclass, its superclass's noarg constructor is always invoked.

To call a superclass constructor, or to call a superclass method.

What are the two ways the keyword super can be used?

The superclass of the class in which super appears.

What does the keyword "super" refer to?

Some programming languages allow you to derive a subclass from several classes. This capability is known as multiple inheritance. Java, however, doesnot allow multiple inheritance. A Java class may inherit directly from only one superclass. This restriction is known as single inheritance.

What is single inheritance? What is multiple inheritance? Does Java support multiple inheritance?

extends

What keyword do you use to define a subclass?

throw new IOException("really BAD data");

Write a statement that throws an IOException with the customized message "really BAD data".

throws IOException, WidgetException

Write the clause needed to identify a method as one that may throw an IOException or a WidgetException:

throws IOException

Write the clause needed to identify a method as one that may throw an IOException:

Throwable

esides Object all Exceptions and Errors are descended from the .... class?


Related study sets

Chapter 23: Asepsis, & Infection Control

View Set

Ch. 8 - Skin Integrity and Wound Care

View Set

Nutrition - Ch. 19 -- Nutrition for Patients with Diabetes Mellitus

View Set

Life And Health Insurance Chapter 8

View Set

Security+ Network Security Fundamentals Chapter 12

View Set

Econ 3311 - Money & Banking - Practice Exam # 2

View Set