for循环的方法是:
import java.util.Hashtable;
import java.util.Set;
public class MyHashtableRead {
public static void main(String a[]){
Hashtable hm = new Hashtable
();
//add key-value pair to Hashtable
hm.put("first", "FIRST INSERTED");
hm.put("second", "SECOND INSERTED");
hm.put("third","THIRD INSERTED");
System.out.println(hm);
Set keys = hm.keySet();
for(String key: keys){
System.out.println("Value of "+key+" is: "+hm.get(key));
}
}
}