You are writing an inventory system for a library.
First, you will create a "Book" class with fields containing information on the publish year (an integer), number of pages (an integer), title, and author. There should be getter and setter methods for both. The year setter should make sure the user doesn't pass a negative value or a value greater than 2021. The number of pages setter should make sure the user doesn't pass a negative value. Also override toString to print all info about a book and make sure the Constructor allows the user to set all data about a book and performs the same input validation.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here