java.util.HashTable 클래스 – 예제 import java.util.*;
public class HashtableTest {
public static void
main(String[] args) {
Hashtable hash = new Hashtable();
hash.put("Name", new String("jclee"));
hash.put("Age", new
Integer(100));
String name = (String)hash.get("Name");
if (name != null) {
System.out.println("Name = " + name);
}
Integer age = (Integer)hash.get("Age");
if (age !=
null) {
System.out.println("Age = " + age.intValue());
}
}
}
댓글 없음:
댓글 쓰기