Collection和Collections有什么区别?

Collection是JDK中集合层次结构中的最根本的接口。定义了集合类的基本方法。源码中的解释:

  1. * The root interface in the <i>collection hierarchy</i>. A collection
  2. * represents a group of objects, known as its <i>elements</i>. Some
  3. * collections allow duplicate elements and others do not. Some are ordered
  4. * and others unordered. The JDK does not provide any <i>direct</i>
  5. * implementations of this interface: it provides implementations of more
  6. * specific subinterfaces like <tt>Set</tt> and <tt>List</tt>. This interface
  7. * is typically used to pass collections around and manipulate them where
  8. * maximum generality is desired.

 

Collections是一个包装类。它包含有各种有关集合操作的静态多态方法,不能实例化,像一个Collection集合框架中的工具类。

  1. * This class consists exclusively of static methods that operate on or return
  2. * collections. It contains polymorphic algorithms that operate on
  3. * collections, "wrappers", which return a new collection backed by a
  4. * specified collection, and a few other odds and ends.

 

Java

ArrayList和Vector的联系和区别

2020-7-23 21:15:12

Java

List、Set、Map 之间的区别是什么?

2020-7-23 21:15:51

本站所发布的一切源码、模板、应用等文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权。本站内容适用于DMCA政策。若您的权利被侵害,请与我们联系处理,站长 QQ: 84087680 或 点击右侧 私信:盾给网 反馈,我们将尽快处理。
⚠️
本站所发布的一切源码、模板、应用等文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权。本站内容适用于DMCA政策
若您的权利被侵害,请与我们联系处理,站长 QQ: 84087680 或 点击右侧 私信:盾给网 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
欢迎您,新朋友,感谢参与互动!
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
私信列表
搜索