Sfoglia il codice sorgente

Implementation of BookFactory class

BookFactory is now implemented to handle all the books.
master
BinHong Lee 8 anni fa
parent
commit
960d43e6fd
1 ha cambiato i file con 25 aggiunte e 0 eliminazioni
  1. +25
    -0
      BookFactory.java

+ 25
- 0
BookFactory.java Vedi 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);
}
}

Caricamento…
Annulla
Salva