Can i implement deep copy and shallow copy in following way?Is it correct? Any one on the following 2 clone methods would be placed in final code
public class Student{
private String name;
private DepartMent dept;
//deep copy
public Object clone() throws CloneNotSupportedException{
Student s = (Student)super.clone();
s.septDept((Department)dept.clone());
}
//shallow copy
public Object clone() throws CloneNotSupportedException{
return super.clone();
}
}