Multiple Choice
Given the following constructor code, which of the statements are TRUE?
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) There is an error: a throws clause should be added to the constructor header.
B) Classes extending the Exception class should be created for each of the custom exceptions that are thrown in the constructor.
C) The calling method must handle the exceptions thrown in the constructor, or have its own throws clause specifying them.
D) All of the above
Correct Answer:

Verified
Correct Answer:
Verified
Q15: All exceptions are instances of classes that
Q16: The following catch statement can: catch (Exception
Q17: Unchecked exceptions are those that inherit from:<br>A)
Q18: All of the exceptions that you will
Q19: To read data from a binary file
Q21: What is demonstrated by the following code?<br>Try<br>{<br>(try
Q22: If you want to append data to
Q23: If the IOData.dat file does not exist,
Q25: A(n) _ is an object that is
Q44: The call stack is an internal list