Multiple Choice
Assume that the classes BlankISBN, NegativePrice, and NegativeNumberOrdered are exception classes that inherit from Exception. The following code is a constructor for the Book class. What must be TRUE about any method that instantiates the Book class with this constructor?
Public Book(String ISBNOfBook, double priceOfBook,
Int numberOrderedOfBook) throws BlankISBN,
NegativePrice,
NegativeNumberOrdered
{
If (ISBNOfBook == "")
Throw new BlankISBN() ;
If (priceOfBook < 0)
Throw new NegativePrice(priceOfBook) ;
If (numberedOrderedOfBook < 0)
Throw new NegativeNumberOrdered(numberOrderedv) ;
ISBN = ISBNOfBook;
Price = priceOfBook;
NumberedOrdered = numberOrderedOfBook;
}
A) It must call the constructor with valid data or a compiler error will occur.
B) It must contain an inner class that extends the IOException class.
C) It must handle all of the possible exceptions thrown by the constructor or have its own throws clause specifying them.
D) All of the above
Correct Answer:

Verified
Correct Answer:
Verified
Q24: When an exception is thrown by a
Q33: To write data to a binary file
Q34: The IllegalArgumentException class extends the RuntimeException class,
Q36: If the program does not handle an
Q37: Look at the following code: FileInputStream fstream
Q39: If the code in a method can
Q40: When you write a method that throws
Q41: The ability to catch multiple types of
Q42: Beginning in Java 7, multi-catch can reduce
Q43: The numeric classes' "parse" methods all throw