File tree Expand file tree Collapse file tree 3 files changed +12
-230
lines changed Expand file tree Collapse file tree 3 files changed +12
-230
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
package kevinGates ;
2
2
3
+ import java .util .Collection ;
3
4
import java .util .HashMap ;
4
5
import java .util .Map ;
6
+ import java .util .Set ;
5
7
6
8
public class HashMapExample {
7
9
@@ -17,6 +19,16 @@ public static void hashMapExampleOne() {
17
19
users .put (2 , "billgates" );
18
20
users .put (3 , "obama" );
19
21
22
+ int size = users .size ();
23
+ boolean isEmpty = users .isEmpty ();
24
+ Set <Integer > keys = users .keySet ();
25
+ Collection <String > values = users .values ();
26
+
27
+ System .out .println (size );
28
+ System .out .println (isEmpty );
29
+ System .out .println (keys );
30
+ System .out .println (values );
31
+
20
32
System .out .println (users );
21
33
System .out .println (users .get (2 ));
22
34
users .remove (3 );
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments