-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestBibliotheque.java
More file actions
36 lines (27 loc) · 1.26 KB
/
Copy pathTestBibliotheque.java
File metadata and controls
36 lines (27 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package td2Class.bibliotheque;
public class TestBibliotheque {
public static void main(String[] args) {
Bibliotheque bibliotheque = new Bibliotheque(2);
Livre livre = new Livre(3, "Harry Potter", "J. K. Rowling", 4000);
bibliotheque.ajouter(livre);
System.out.println("Nombre de document: " + bibliotheque.getNbrDocs());
bibliotheque.afficherDocuments();
bibliotheque.afficherAuteurs();
Document doc = bibliotheque.document(0);
bibliotheque.supprimer(doc);
System.out.println("Nombre de document: " + bibliotheque.getNbrDocs());
bibliotheque.afficherDocuments();
bibliotheque.afficherAuteurs();
Revue rev = new Revue(5, "Programmez", 12, 2014);
bibliotheque.ajouter(livre);
bibliotheque.ajouter(rev);
System.out.println("Nombre de document: " + bibliotheque.getNbrDocs());
bibliotheque.afficherDocuments();
bibliotheque.afficherAuteurs();
Roman rom = new Roman(6, "Harry Potter 2", "J. K. Rowling", 4000, PrixLitteraire.GONCOURT);
bibliotheque.ajouter(rom);
System.out.println("Nombre de document: " + bibliotheque.getNbrDocs());
bibliotheque.afficherDocuments();
bibliotheque.afficherAuteurs();
}
}