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 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
Get step-by-step solutions from verified subject matter experts
