Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void insert_to_bookList(Book _input){
- int ListSize = BookList.size();
- boolean found=false;
- if (ListSize == 0) {
- BookList.add(_input);
- System.out.println("Book Added!");
- }else{
- for (Book entry : BookList) {
- if (_input.CallNumber.equals(entry.CallNumber) && _input.bookYear.equals(entry.bookYear)) {
- System.out.println("\nSorry that book already exists");
- found = true;
- }
- }
- if (found != true){
- BookList.add(_input);
- System.out.println("Book Added!!!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement