摘要: 集合的遍历 集合的遍历:目的就是将集合中的元素依次取出来 Object[] toArray() 需求1、 把集合转成数组,可以实现集合的遍历 public class CollectionDemo3 { public static void main(String[] args) { //创建集合对 阅读全文
posted @ 2021-12-18 22:46 欧朋 阅读(51) 评论(0) 推荐(0)
摘要: 集合类——collection接口的成员方法 Collection:是集合中的顶层接口,它存在由它扩展开来的继承体系,为什么要分出很多不同的集合? 根据元素是否唯一,是否有序来区分这么多集合(后面的课程中会一一介绍) Collection: 1、添加功能 boolean add(Object obj 阅读全文
posted @ 2021-12-18 22:19 欧朋 阅读(70) 评论(0) 推荐(0)
摘要: 集合继承体系 案例 需求:利用数组存储3个学生信息,遍历数组获取每一个学生的信息 定义完整学生类 public class Student{ private String name; private int age ; ​ public Student() { } ​ public Student( 阅读全文
posted @ 2021-12-18 19:59 欧朋 阅读(114) 评论(0) 推荐(0)