//2.2 /* +---------------+ | Book | +---------------+ | String title | | String author | | int year | | double price | +---------------+ */ // To describe a book class Book { String title; String author; int year; double price; Book(String title, String author, int year, double price) { this.title = title; this.author = author; this.year = year; this.price = price; } } class Examples { Examples() {} Book b1 = new Book("Robinson Crusoe", "Daniel Defoe", 1719, 15.50); Book b2 = new Book("Heart of Darkness", "Joseph Conrad", 1902, 12.80); Book b3 = new Book("Beach Music", "Pat Conroy", 1996, 9.50); } /* new Book("The Little LISPer", "D.P. Friedman", 1974, 900) This means that there is a book called "The Little LISPer" by D.P. Friedman, written in 1974 and it costs $900. This makes sense but is a bit unrealistic because the book is so expensive */