Update Main.java
fixing bug Program is causing a NoSuchElementException
This commit is contained in:
parent
ecfbadc789
commit
dd73b46a25
@ -8,6 +8,7 @@ public class Main {
|
||||
int choice, key;
|
||||
|
||||
HashMap h = new HashMap(7);
|
||||
Scanner In = new Scanner(System.in);
|
||||
|
||||
while (true) {
|
||||
System.out.println("Enter your Choice :");
|
||||
@ -15,9 +16,7 @@ public class Main {
|
||||
System.out.println("2. Delete Key");
|
||||
System.out.println("3. Print Table");
|
||||
System.out.println("4. Exit");
|
||||
|
||||
Scanner In = new Scanner(System.in);
|
||||
|
||||
|
||||
choice = In.nextInt();
|
||||
|
||||
switch (choice) {
|
||||
@ -39,10 +38,11 @@ public class Main {
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
In.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
In.close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user