Skip to content

Commit e11430b

Browse files
Add files via upload
1 parent d060102 commit e11430b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

mapmethods5.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import java.util.HashMap;
2+
public class mapmethods5 {
3+
public static void main(String[] args) {
4+
HashMap<String, Integer> map = new HashMap<>();
5+
6+
map.put("One", 1);
7+
map.put("Two", 2);
8+
map.put("Three", 3);
9+
map.put("Four", 4);
10+
map.put("Five", 5);
11+
map.put("Six", 6);
12+
System.out.println( map);
13+
map.forEach((String key, Integer value) -> {
14+
System.out.println(key + ":" + value);
15+
});
16+
17+
18+
19+
}
20+
21+
}

0 commit comments

Comments
 (0)