java 集合 Collection接口 List 和Set

来源:互联网 发布:熊猫tv直播软件 编辑:程序博客网 时间:2024/05/16 11:45

 Collection接口

--子接口List(可重复) 和Set(不可重复) //以上都是接口


Collection接口常用的方法

add   remove


List子接口丰富了方法   

常用方法:set get 

Set子接口 和Collection接口基本相同 没有提供额外的方法 


List接口

—ArrayList(90%)实现类和Vector(10%)实现类


Set子接口

—HashSet(80%)实现类 ,TreeSet实现类和 EnumSet实现类

HashSet 实现不能重复的乱排序 

TreeSet  实现不能重复的有序排序

0 0
原创粉丝点击