Explorar el Código

Implementation of BookFactory class

BookFactory is now implemented to handle all the books.
master
BinHong Lee hace 8 años
padre
commit
960d43e6fd
Se han modificado 1 ficheros con 25 adiciones y 0 borrados
  1. +25
    -0
      BookFactory.java

+ 25
- 0
BookFactory.java Ver fichero

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

Cargando…
Cancelar
Guardar