Guest User

Untitled

a guest
Apr 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. else if(dChoice == 't' || dChoice == 'T') {         // Ta bort namn {
  2.     System.out.print("Ta bort hund vid namn:\t");
  3.     String dName = in.nextLine();
  4.     boolean dMatch = false;
  5.     for (int x=0; x<al.size(); x++) {
  6.         dMatch = al.get(x).getName().equalsIgnoreCase(dName);
  7.         if(dMatch) {
  8.             System.out.print(al.get(x).getName());
  9.             System.out.flush();
  10.             al.remove(x);
  11.             System.out.println(" har blivit borttagen.");
  12.         }
  13.     }
  14.     System.out.println();
  15. }                               // } Ta bort namn
Add Comment
Please, Sign In to add comment