Parcourir la source

update console with nextline instead of next

Jonathan Hinds il y a 6 ans
Parent
révision
d8a9e8abcb
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2
    2
      src/main/java/io/zipcoder/casino/Console.java

+ 2
- 2
src/main/java/io/zipcoder/casino/Console.java Voir le fichier

@@ -14,7 +14,7 @@ public class Console {
14 14
     public void createAccount()
15 15
     {
16 16
         System.out.println("Hello, what is your name?");
17
-        String name = scanner.next();
17
+        String name = scanner.nextLine();
18 18
 
19 19
         System.out.println("How much money are you bringing to the table?");
20 20
         int balance = getIntFromUser();
@@ -99,7 +99,7 @@ public class Console {
99 99
 
100 100
     public String getCommand() {
101 101
         String command = "";
102
-        String input = scanner.next();
102
+        String input = scanner.nextLine();
103 103
         input = input.toLowerCase().trim();
104 104
 
105 105
         for(String name : gameLib){