Map遍历以及集合

一.关于遍历map集合
1.通过map.keySet()遍历key和value
2.通过map.entrySet用迭代器来遍历key和value
3.通过map.entrySet()用增强for循环来遍历key和value
4.通过map.values()来遍历value,不能遍历key
二.ArrayList和LinkedList.Vector
1.都实现了List接口
2.ArrayList u操作 可变大小的数组,可直接通过get/set方法进行访问
LinkedList 双向链表,插入数据块,crd操作,get/set方面弱于ArrayList
Vector 同步类,且线程安全

猜你喜欢

转载自blog.csdn.net/weixin_43052839/article/details/82222235