Skip to content

Commit 72526b7

Browse files
committed
update
1 parent 54dfb4f commit 72526b7

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

src/kevinGates/HashMapExample.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
import java.util.HashMap;
55
import java.util.Map;
66
import java.util.Set;
7+
import kevinGates.java.util.HashMapKevin;
78

89
public class HashMapExample {
910

1011
public static void main(String args[]) {
1112

12-
hashMapExampleOne();
13+
//hashMapExampleOne();
14+
hashMapExampleTwo();
1315
}
1416

1517
public static void hashMapExampleOne() {
@@ -36,4 +38,13 @@ public static void hashMapExampleOne() {
3638
users.clear();
3739
System.out.println(users.get(1));
3840
}
41+
42+
public static void hashMapExampleTwo() {
43+
HashMapKevin users = new HashMapKevin<Integer, String>();
44+
//users.echo("map");
45+
users.echo("data");
46+
47+
HashMapKevin usersOne = new HashMapKevin<Integer, String>(88);
48+
usersOne.echo("usersOne="+usersOne.currentKey);
49+
}
3950
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package kevinGates.java.util;
2+
3+
abstract public class AbstractMapKevin {
4+
5+
public void echo(String any) {
6+
System.out.println(any);;
7+
}
8+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package kevinGates.java.util;
2+
3+
4+
public class HashMapKevin<K,V> extends AbstractMapKevin implements MapKevin {
5+
public int currentKey;
6+
public HashMapKevin() {
7+
8+
}
9+
10+
public HashMapKevin(int key) {
11+
this.currentKey = key;
12+
}
13+
14+
public boolean isEmpty() {
15+
16+
return true;
17+
}
18+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package kevinGates.java.util;
2+
3+
public interface MapKevin {
4+
public void echo(String any);
5+
boolean isEmpty();
6+
}

0 commit comments

Comments
 (0)