Strike Freedom

Live fast. Die young. Be wild. Have fun.

Discovery

java之hashtable和hashmap

hashtable和hashmap是java里面常见的容器类,是Java.uitl包下面的类,那么Hashtable和Hashmap是怎么实现hash键值对配对的呢,我们看看jdk里面的源码,分析下Hashtable的构造方法,put(K, V)加入方法和get(Object)方法就大概明白了。 一、Hashtable的构造方法:Hashtable(int initialCapacity, float loadFactor) public Hashtable(int initialCapacity, float loadFactor) { if (initialCapacity < 0) throw new IllegalArgumentException("Illegal Capacity: "+ initialCapacity); if (loadFactor <= 0 || Float.isNaN(loadFactor))

Live fast. Die young. Be wild. Have fun.

© 2020 Strike Freedom

Powered by Bolo
Theme bolo-sakura by Mashiro
浏览 331907 文章 46 评论 152

SCHEME TOOL