Java Programming Assignment

KhaledMaarof
Book.java

/* Book.java * This file contains the declaration for the Book class of objects, * as used in our textbook * last edited November 20, 2019 by C. Herbert * The file declaring the Book class must be visible to this Main class. */ package BookProject; public class Book { // declare properties private String isbn; private String title; private String subject; private double price; // constructor methods ****************************** Book() { } // end Book() Book(String isbn, String title) { this.isbn = isbn; this.title = title; } // end Book(String number, String name) // accessor methods ******************************* public String getTitle() { return title; } // end getTtitle() public String getISBN() { return isbn; } // end getISBN() public String getSubject() { return subject; } // end getsubject() public double getPrice() { return price; } // end setPrice() // mustator methods ****************************** public void setTitle(String name) { title = name; } // end setTtitle() public void setISBN(String number) { isbn = number; } // end setISBN() public void setSubject(String sub) { subject = sub; } // end setsubject() public void setPrice(double value) { price = value; } // end setPrice() // method to return information about the book as a String public String toString() { return ("Title: " + title + " ISBN: " + isbn); // end to String() } // end main() } // end class Book