集合
Zzz丶丶
这个作者很懒,什么都没留下…
展开
-
Java-集合
对象数组对象数组概述A:基本类型的数组:存储的元素为基本类型 int[] arr={1,2,3,4} B:对象数组:存储的元素为引用类型 Student[] stus=new Student[3];Student代表一个自定义类 Stus数组中stus[0],stus[1],stus[2]的元素数据类型为Student创建一个学生数组,存储三个学生对象并遍历public class St原创 2017-07-27 20:40:03 · 409 阅读 · 0 评论 -
集合进阶
集合&迭代器集合体系结构集合体系图public class CollectionDemo { public static void main(String[] args) { //创建集合对象 ArrayList al = new ArrayList(); //添加元素 al.add("hello");原创 2017-07-30 22:11:52 · 252 阅读 · 0 评论 -
集合进阶2
HashSet集合Set接口的特点A:存入集合的顺序和取出集合的顺序不一致B:没有索引C:存入集合的元素没有重复HashSet使用&唯一性原理HashSet的使用 public class HashSetDemo2 { public static void main(String[] args) { //创建集合对象 HashSet<Student> h原创 2017-07-31 23:25:03 · 204 阅读 · 0 评论