close
HashTable can improve our search time when we need to find data.
There is a example for HashTable class in java :
import java.util.Hashtable;
Hashtable<String, Integer> numbers = new Hashtable<String, Integer>();
numbers.put("one", 1);
numbers.put("two", 2);
numbers.put("three", 3);
Integer n = numbers.get("two");
if (n != null)
{
System.out.println("two = " + n);
}
Integer n = numbers.get("two");
this line means that we can get the association value of "two" if we find the key value "two".
ref : http://docs.oracle.com/javase/7/docs/api/java/util/Hashtable.html
文章標籤
全站熱搜
留言列表