上传者: liuzhanchao5678
|
上传时间: 2021-11-19 19:48:03
|
文件大小: 25KB
|
文件类型: -
Student student=new Student();
(Student2)student //在这个表达式(记得光标在表达式里面哦)按下alt+Enter,选中“哟嚯。。。好爽啊”就能自动生成下面代码
Student2 student2=new Student2();
student2.setFiled1(student.getFiled1());
student2.setFiled2(student.getFiled2());
student2.setFiled3(student.getFiled3());
student2.setFiled4(student.getFiled4());
student2.setFiled5(student.getFiled5());
student2.setFiled6(student.getFiled6());
student2.setFiled7(student.getFiled7());
student2.setFileD8(student.getFileD8());
》》》》》》》》》》》》你还可以这样
List students=new ArrayList();
(Student2)students//在这个表达式(记得光标在表达式里面哦)按下alt+Enter,选中“哟嚯。。。好爽啊”就能自动生成下面代码
for(Student student:students){
Student2 student2= new Student2();
student2.setFiled1(student.getFiled1());
student2.setFiled2(student.getFiled2());
student2.setFiled3(student.getFiled3());
student2.setFiled4(student.getFiled4());
student2.setFiled5(student.getFiled5());
student2.setFiled6(student.getFiled6());
student2.setFiled7(student.getFiled7());
student2.setFileD8(student.getFileD8());
student2Lst.add(student2);
}
不会安装idea插件请自行百度啊。