JAVA基础(001_Collection与Collections的区别)

来源:互联网 发布:博罗县网络问政平台 编辑:程序博客网 时间:2024/06/06 05:45

Collection与Collections的区别

  • Collection(Interface Collection<E>):集合顶级接口,List与Set均继承了此接口。

    All Known Subinterfaces:
    BeanContext, BeanContextServices, BlockingDeque<E>, BlockingQueue<E>, Deque<E>, List<E>, NavigableSet<E>, Queue<E>, Set<E>, SortedSet<E>, TransferQueue<E>

  • Collections(public class Collections extends Object):集合工具类/帮助类,提供各种用于对集合中的元素进行排序、搜索以及线程安全等操作的静态方法。此类不能实例化(构造方法为private)。

    官方文档:http://docs.oracle.com/javase/8/docs/api/index.html

0 0
原创粉丝点击