Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
Map<String, Integer> map = new HashMap<String, Integer>();
|
||||
map.put("foo", 5);
|
||||
map.put("bar", 10);
|
||||
map.put("baz", 15);
|
||||
map.put("foo", 6);
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
public static Map<String, Integer> map = new HashMap<String, Integer>(){{
|
||||
put("foo", 5);
|
||||
put("bar", 10);
|
||||
put("baz", 15);
|
||||
put("foo", 6);
|
||||
}};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
map.get("foo"); // => 5
|
||||
map.get("invalid"); // => null
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
for (String key: map.keySet())
|
||||
System.out.println(key);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
for (int value: map.values())
|
||||
System.out.println(value);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
for (Map.Entry<String, Integer> entry: map.entrySet())
|
||||
System.out.println(entry.getKey() + " => " + entry.getValue());
|
||||
Loading…
Add table
Add a link
Reference in a new issue