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)
{
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 these are true.
Correct Answer:

Verified
Correct Answer:
Verified
Q6: The catch clause _.<br>A) starts with the
Q7: What happens if a program does not
Q8: An exception's default error message can be
Q9: A(n) _ contains one or more statements
Q10: If a method does not handle a
Q12: If your code does not handle an
Q13: In a catch statement, what does the
Q14: To write data to a binary file,
Q15: In Java there are two categories of
Q16: In the following code, assume that inputFile