CMSC 132A Lecture 26: A Library class

67 views4 pages
CMSC132A Lecture 26: A Library class
Class Book{
String title;
String ISBN;
Author author;
Book(String title, String ISBN, Author author){
this.title=title;
this.ISBN=ISBN;
this.author=author;
//effect on author update their book to this book
this.author.setBook(this);
}
}
Class Author{
String name;
Book book;
Author(String name, Book book){
this.name=name;
this.book=book;
}
Void setBook(Book b){
Unlock document

This preview shows page 1 of the document.
Unlock all 4 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions