Browse Source

Implementation of BookFactory class

BookFactory is now implemented to handle all the books.
master
BinHong Lee 8 years ago
parent
commit
960d43e6fd
1 changed files with 25 additions and 0 deletions
  1. +25
    -0
      BookFactory.java

+ 25
- 0
BookFactory.java View File

@@ -0,0 +1,25 @@
import java.util.*;

class BookFactory
{
private List<Book> books = new ArrayList<Book>();
private int id;

public BookFactory()
{
id = 0;
}

public void newBook()
{
Book temp = new Book(id, "NOT AVAILABLE");
books.add(temp);

id++;
}

public Book getBook(int index)
{
return books.get(index);
}
}

Loading…
Cancel
Save