判断Hashtable的name-value
Hashtable<String, String> ht = new Hashtable<String, String>();
ht.put("1", "111");
ht.put("2", "222");
ht.put("3", "333");
ht.put("4", "444");
ht.put("5", "555");
ht.put("6", "666");
ht.put("7", "777");
ht.put("8", "888");
ht.put("9", "999");
ht.put("0", "000");
//
// if(ht != null){
// Enumeration<String> enu = ht.keys();
// while(enu.hasMoreElements()){
// String key = enu.nextElement();
// String value = ht.get(key);
// System.out.println(key+"~"+value+"\r\n");
// }
// }
if (ht.isEmpty()) {
System.out.println("is null");
}
if (ht != null) {
System.out.println("is not null");
Enumeration<String> enu = ht.keys();
while (enu.hasMoreElements()) {
System.out.println("-------------start----------------");
String key = enu.nextElement();
String value = ht.get(key);
System.out.println(key + "~" + value + "\r\n");
}
}