Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.llm.TP_Heritage.model;
- import java.util.ArrayList;
- import fr.llm.TP_Heritage.model.BookExo1;
- public class BookStoreExo1 {
- private ArrayList<BookExo1> maListeBookExo1;
- public BookStoreExo1() {
- this.maListeBookExo1 = new ArrayList<BookExo1>();
- }
- public void addBook(int rfidInit, String auteurInit, String titreInit, String dateAchatInit, double prixAchatInit) {
- maListeBookExo1.add(new BookExo1(rfidInit, auteurInit, titreInit, dateAchatInit, prixAchatInit));
- }
- public void displayBook() {
- System.out.println(maListeBookExo1.size());
- int i;
- for(i=0; i<maListeBookExo1.size(); i++) {
- System.out.println(maListeBookExo1.get(i));
- }
- }
- public void findIndex() {
- int j;
- int max=0;
- for(j=0; j<maListeBookExo1.size(); j++) {
- if (maListeBookExo1.get(j).getRfid() > max) {
- max = maListeBookExo1.get(j).getRfid();
- }
- }
- System.out.println("Le plus grand tag rfid est : " + max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement