Bläddra i källkod

Implementation of BookFactory class

BookFactory is now implemented to handle all the books.
master
BinHong Lee 8 år sedan
förälder
incheckning
960d43e6fd
1 ändrade filer med 25 tillägg och 0 borttagningar
  1. +25
    -0
      BookFactory.java

+ 25
- 0
BookFactory.java Visa fil

@@ -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);
}
}

Laddar…
Avbryt
Spara