Java Programming Assignment

KhaledMaarof
Main.java

/* Main.java * This file contains the executable class for a project * demonstrating the use of a Book object * 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 Main { public static void main(String[] args) { // create an instance of the book class with an ISBN and title Book myBook = new Book("978-02-62031417", "Introduction To Algorithms"); // add a subject myBook.setSubject("Computer Science"); // add a price myBook.setPrice(64.95); // print the information about the book System.out.println(myBook.toString()); System.out.println("The price of the book is: " + myBook.getPrice()); System.out.println("The subject is: " + myBook.getSubject()); } // end main() } // end class Main