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) A FileNotFoundException will be thrThe calling method must handle the exceptions thrown in the constructor, or have its own throws clause specifying them.
D) All of these are true.
Correct Answer:

Verified
Correct Answer:
Verified
Q34: In order for an object to be
Q35: The numeric classes' parse methods all throw
Q36: The throws clause causes an exception to
Q37: When an object is serialized, it is
Q38: The throw statement informs the compiler that
Q40: If the data.dat file does not exist,
Q41: In a try/catch construct, after the catch
Q42: The ability to catch multiple types of
Q43: Unchecked exceptions are those that inherit from
Q44: The call stack is an internal list