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
Q1: To serialize an object and write it
Q9: A class must implement the Serializable interface
Q12: What will be the result of the
Q13: What will the following code display?<br>String input
Q18: All of the exceptions that you will
Q23: Look at the following code: FileInputStream fstream
Q25: A(n) _ is an object that is
Q29: When deserializing an object using the readObject
Q44: The call stack is an internal list
Q47: The throw statement informs the compiler that