How can I copy an object containing an array of other objects? Here is my copy constructor:
public university(university univ) {
String name1=univ.getname();
int numOfPublications1=univ.getnumOfPublications();
Department[] depts1 =new Department[numOfDepts];
depts1=univ.getdepts();
}
This is not working because the array is not there.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…