Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
|
- 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);
- }
- }
|