面试啦 - 提供专业面试问题及答案、面试技巧、助您成功面试!
您的当前位置:首页 > 面试题库 > IT面试题 > JAVA程序员 > 正文

Vector, ArrayList, HashTable, HashMap哪些是线程安全的,哪些不是

Vector and Hashtable are two collection classes that are inherently thread safe or synchronized; whereas, the classes ArrayList and HashMap are unsynchronized and must be `wrapped` via Collections.SynchronizedList or Collections.synchronizedMap if synchronization is desired.
Vector和Hashtable是线程安全的,ArrayList和HashMap不是线程安全的而且必须要通过Collections.SynchronizedList或者Collections.synchronizedMap来包装一下才能实现同步。
词条:java面试题 java程序员面试题
上一篇:什么时候用assert 下一篇:日期和时间问题
与该文相关的文章

温馨提示:如果您对面试网有任何建议,请通过网站联系邮箱向我们反馈,感谢各位的建议与支持!