fix bug
This commit is contained in:
1 parent
67e31dba87
commit
4b00d5838c
2 files changed
+5
-4
No files matched your search
+4
-3
@@ -11,7 +11,7 @@ public class Test {
|
||||
Scanner sc = new Scanner(System.in);
|
||||
while (continueBuy) {
|
||||
System.out.print("Please enter your name: ");
|
||||
name = sc.next();
|
||||
name = sc.nextLine();
|
||||
System.out.print("Please enter your payment: ");
|
||||
payment = sc.nextInt();
|
||||
Thread consumer = new Thread(ts, name + "-" + payment);
|
||||
@@ -22,8 +22,9 @@ public class Test {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("Do you want to continue buying tickets? Y: Yes, N: No");
|
||||
continueBuy = sc.next().equalsIgnoreCase("Y");
|
||||
continueBuy = "Y".equalsIgnoreCase(sc.next());
|
||||
sc.nextLine();
|
||||
}
|
||||
sc.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,4 +71,4 @@ public class TicketSeller implements Runnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user