Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 0 1 1 point Assume that the classes BlankISBN, NegativePrice, and NegativeNumberOrdered are exception classes that inherit from Exception. The following code is a
point
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 BookString ISBNOfBook, double priceOfBook, int numberOrderedOfBook
if ISBNOfBook n
throw new BlankISBN;
if priceOfBook
throw new NegativePricepriceOfBook;
if numberedOrderedOfBook
throw new NegativeNumberOrderednumberOrderedv;
ISBN ISBNOfBook;
price priceOfBook;
numberedOrdered numberOrderedOfBook;
It must handle all of the possible exceptions thrown by the constructor or have its own throws clause specifying them.
All of these are true.
It must call the constructor with valid data or a compiler error will occur.
It must contain an inner class that extends the IOException class.
Clear my selection
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started