找工做——集合框架

HashMap和HashTable
都採用了hash法進行索引
HashMap容許鍵值爲空(但只容許一條爲空),而HashTable不容許。
HashMap是非線程安全的,而HashTable是線程安全的。
HashMap使用Iterator,HashTable使用Enumeration
hash值使用不一樣,HashTable直接使用對象的hashCode。安全

相關文章
相關標籤/搜索