Java程序设计案例教程教学课件作者张瑞英第7章节标准类库和常用工具类课件.pptVIP

  • 3
  • 0
  • 约1.63万字
  • 约 46页
  • 2018-01-21 发布于未知
  • 举报

Java程序设计案例教程教学课件作者张瑞英第7章节标准类库和常用工具类课件.ppt

HashSet HashSet创建哈希集的方式如下几种: 方式一:HashSet 对象名=new HashSet(); 方式二:HashSet 对象名=new HashSet(Collection c); 方式三:HashSet 对象名=new HashSet(int arg); List接口和ArrayList类 List继承了Collection接口,它表示对象可重复的集合。List集合的元素是有顺序的。因此,该接口增加了对集合中元素位置的操作。为此,List接口重定义了一些与位置操作有关的方法。这些方法的具体应用会在List接口的实现类中介绍。实现List的类主要是ArrayList和Vertor。 ArrayList ArrayList集合的创建方式有如下几种: 方式一:ArrayList 对象名=new ArrayList (); 方式二:ArrayList 对象名=new ArrayList (Collection c); 方式三:ArrayList 对象名=new ArrayList (int arg); ArrayList类的常用的方法 (1) 容量调整方法。 语法格式:public void ensureCapacity(int arg); 功能:增加集合的容量,容量大小由arg指定。该方法一般用在确

文档评论(0)

1亿VIP精品文档

相关文档