data-structures/java/Dictionary/KVpair.java

25 lines
323 B
Java
Raw Normal View History

2022-09-15 13:14:24 +00:00
/** Container class for a key-value pair */
class KVpair<Key, E> {
private Key k;
private E e;
/** Constructors */
KVpair() {
k = null;
e = null;
}
KVpair(Key kval, E eval) {
k = kval; e = eval;
}
/** Data member access functions */
public Key key() {
return k;
}
public E value() {
return e;
}
}