We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecfbadc commit dd73b46Copy full SHA for dd73b46
DataStructures/HashMap/Hashing/Main.java
@@ -8,16 +8,15 @@ public static void main(String[] args) {
8
int choice, key;
9
10
HashMap h = new HashMap(7);
11
+ Scanner In = new Scanner(System.in);
12
13
while (true) {
14
System.out.println("Enter your Choice :");
15
System.out.println("1. Add Key");
16
System.out.println("2. Delete Key");
17
System.out.println("3. Print Table");
18
System.out.println("4. Exit");
-
19
- Scanner In = new Scanner(System.in);
20
+
21
choice = In.nextInt();
22
23
switch (choice) {
@@ -39,10 +38,11 @@ public static void main(String[] args) {
39
38
break;
40
}
41
case 4: {
+ In.close();
42
return;
43
44
45
- In.close();
46
47
48
0 commit comments