Question: QUESTION 4 Create a Java class named Book with: 1. Private instance variables for the title (string), author (string), ISBN, (string) and year Published (int).

 QUESTION 4 Create a Java class named Book with: 1. Private

QUESTION 4 Create a Java class named Book with: 1. Private instance variables for the title (string), author (string), ISBN, (string) and year Published (int). 2. A four-argument constructor to set each of the instance variables above. If the ISBN is not all digits or the number of digits is not either 10 or 13, throw an IllegalArgumentException to tell the user which type of error has been encountered. 3. Get and Set methods for each instance variable with the same error detection as the constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!