import
java.util.Enumeration;
import
java.util.Hashtable;
public
class
GFG {
public
static
void
main(String a[])
{
Hashtable<String, String> hm
=
new
Hashtable<String, String>();
hm.put(
"Name"
,
"Bahubali"
);
hm.put(
"College"
,
"Amarnath"
);
hm.put(
"Department"
,
"Vedics"
);
Enumeration<String> keys = hm.keys();
while
(keys.hasMoreElements()) {
String key = keys.nextElement();
System.out.println(
"Value of "
+ key
+
" is: "
+ hm.get(key));
}
System.out.println();
Hashtable<String, String> hm1
=
new
Hashtable<String, String>();
hm1.put(
"Name"
,
"Ravaan"
);
hm1.put(
"College"
,
"SriLanka"
);
hm1.put(
"Department"
,
"CS"
);
Enumeration<String> keys1 = hm1.keys();
while
(keys1.hasMoreElements()) {
String key = keys1.nextElement();
System.out.println(
"Value of "
+ key
+
" is: "
+ hm1.get(key));
}
System.out.println();
Hashtable<String, String> hm2
=
new
Hashtable<String, String>();
hm2.put(
"Name"
,
"Kattappa"
);
hm2.put(
"College"
,
"Beardo"
);
hm2.put(
"Department"
,
"War"
);
Enumeration<String> keys2 = hm2.keys();
while
(keys2.hasMoreElements()) {
String key = keys2.nextElement();
System.out.println(
"Value of "
+ key
+
" is: "
+ hm2.get(key));
}
}
}