2020-07-22

2020-07-22  本文已影响0人  324_d5df

1.case穿透
2.while(true)的理解
3.关于ArrayList中的元素修改

public static void main(String[] args) {
        ArrayList<Student> array = new ArrayList<Student>();
        Student student = new Student();
        student.setId("1");
        student.setName("张三");
        student.setAddress("北京");
        array.add(student);
        Student student2 = new Student();
        student2.setId("2");
        student2.setName("张三2");
        student2.setAddress("北京2");
        array.add(student2);
        System.out.println(array);
        
        Student student1 = new Student();
        student1.setId("3");
        student1.setName("李四");
        student1.setAddress("南京");
        array.set(1, student1);//(索引,新的元素)
        System.out.println(array);
    }
上一篇下一篇

猜你喜欢

热点阅读