Код: Выделить всё
public class Library {
public static void main(String[] args) {
Book MacMasterRaceVolumeOne = new Book(252510, 2019, "MacMasterRaceVolumeOne");
Book MacMasterRaceVolumeTwo = new Book(252511, 2020, "MacMasterRaceVolumeTwo");
Book MacMasterRaceVolumeThree = new Book(252512, 2021, "MacMasterRaceVolumeThree");
ArrayList bookList = new ArrayList();
bookList.add(MacMasterRaceVolumeOne);
bookList.add(MacMasterRaceVolumeTwo);
bookList.add(MacMasterRaceVolumeThree);
System.out.println(bookList.);
Теперь моя проблема связана со следующей частью проверки, не подделан ли ISBN.
Код: Выделить всё
public boolean isISBNMatching(Book bookHere, ArrayList list) {
if ((list.contains(bookHere.getISBN() == bookHere.getISBN())){
return true;
}
return false;
}
}
Подробнее здесь: https://stackoverflow.com/questions/669 ... -in-a-list
Мобильная версия