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

arrow
arrow
    文章標籤
    Hashtable
    全站熱搜
    創作者介紹
    創作者 JerryCheng 的頭像
    JerryCheng

    KwCheng's blog

    JerryCheng 發表在 痞客邦 留言(0) 人氣()