Book - import java.util.*; public class Book extends...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Book extends Product implements Comparable{ private String author; private String isbn; private int edition; private static int numBooks = 1; public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getIsbn() { return isbn; } public void setIsbn(String isbn) { this.isbn = isbn; } public int getEdition() { return edition; } public void setEdition(int edition) { if (edition > 0) this.edition = edition; } public static int getNumBooks() { return numBooks; } public static void setNumBooks(int num) { numBooks = num; } public String toString() { String ret = super.toString() + ", " + author + ", " + isbn + ", Edition: " + edition + ", " + (this.checkedTo == null ? "checkedIn" : "checkedOut"); if (this.checkedTo != null) ret = ret + ", Due on: " + this.getDueDate(); return ret; } // complete the following methods public Book(String title, String publisher, String author, String isbn, int edition)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Book - import java.util.*; public class Book extends...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online