集合
NoBugNoCode
Today is ruthless and tomorrow will be much more ruthless, but the day after tomorrow will turn out to be beautiful. However, most people will die tomorrow night.
展开
-
Collection Map 总集合 实现类 特点一文尽知
集合的特点长度可变适合存储对象类型,操作比较简单集合的框架体系Collection单列集合 (接口)List: 实现类 ArrayList LinkedList Vector (接口)Set: 实现类原创 2016-10-09 14:23:49 · 520 阅读 · 0 评论 -
集合之 Collection-List->ArrayList三种遍历方式 常用方法
/* * 1.存储对象①数组(一旦创建长度不可变)②集合 * 2.集合可以动态长度存储 * Collection接口: * |—-List接口:存储有序的,可以重复的元素 * |—ArrayList,(主要的)LinkedList,Vector(频繁插入和删除实现类) * |—-Set接口;存储无序,不可以重复的元素 *原创 2016-10-08 00:43:50 · 2253 阅读 · 0 评论 -
集合之-map的两种遍历方式(keySet entrySet)
map集合使用两种方式遍历/** * 此文用于演示Map的遍历方式 * 方式一: 通过调用keySet * * 方式二:通过调用entrySet * */ public class IteratorMap { public static void main(String[] args) { // 创建集合对象 Map map = new HashMa原创 2016-10-08 00:22:29 · 433 阅读 · 0 评论 -
HsahMap HashTable底层实现&异同
HsahMap HashTable底层实现Hashtable的应用非常广泛,HashMap是新框架中用来代替Hashtable的类,也就是说建议使用HashMap,不要使用 Hashtable。可能你觉得Hashtable很好用,为什么不用呢?这里简单分析他们的区别。1、 Hashtable的方法是同步的,HashMap未经同步,所以在多线程场合要手动同步HashMap这个区别就像Vector和Ar原创 2016-10-13 23:32:45 · 904 阅读 · 0 评论