private static void copyTest() {
Worker worker1 = new Worker(
“qinyi”, 19, “m”, “University”, “2000”
);
System.out.println("The original is " + worker1.getEducationInfo().getSchool());
Worker worker2 = (Worker) worker1.clone();
System.out.println("The cloned is " + worker2.getEducationInfo().getSchool());
worker2.getEducationInfo().setSchool("College");
worker2.setName("xxxxx");
System.out.println("The original is " + worker1.getEducationInfo().getSchool());
System.out.println("The cloned is " + worker2.getEducationInfo().getSchool());
System.out.println("The original name is " + worker1.getName());
System.out.println("The cloned name is " + worker2.getName());
}