Kimes

Untitled

Mar 30th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. public void removeBook(Integer bookID) {
  2.         Book bookValues = bookMap.get(bookID);
  3.         if (bookValues != null) {
  4.             if (borrowersMap.get(bookValues) == null) {
  5.                 bookMap.remove(bookID);
  6.                 copiesMap.put(bookValues, copiesMap.get(bookValues) - 1);
  7.             } else {
  8.                 System.out.println("Can't remove that book right now, it's lent");
  9.             }
  10.         } else {
  11.             System.out.println("Invalid ID number");
  12.  
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment