We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7d6ad4 commit 233cb40Copy full SHA for 233cb40
1 file changed
Mini Dictionary.java
@@ -0,0 +1,15 @@
1
+import java.util.*;
2
+
3
+public class Dictionary {
4
+ public static void main(String[] args) {
5
+ HashMap<String, String> map = new HashMap<>();
6
+ map.put("java", "A powerful programming language");
7
+ map.put("python", "Dynamic scripting language");
8
9
+ Scanner sc = new Scanner(System.in);
10
+ System.out.print("Word: ");
11
+ String w = sc.nextLine();
12
13
+ System.out.println(map.getOrDefault(w, "Not found!"));
14
+ }
15
+}
0 commit comments