我们开发的时候可能需要进行对象值的复用,下面给大家介绍一个方法,就是使用BeanUtils。
public static void main(String[] args) throws Exception {
Student student=new Student ("zhangsan",18);
Student1 student1=new Student1 ();
BeanUtils.copyProperties(student, student1);
System.out.println(student1.toString());
}