public Object clone() throws CloneNotSupportedException {
MyNumber myObj = super.clone();
myObj.numbers = (int[]) numbers.clone();
return myObj;
}
이부분에서 캐스팅하는 이유가 궁금합니다. 그냥 numbers.clone() 하면 int[] 데이터타입이 복사가 안되서 해주는건가요?
public Object clone() throws CloneNotSupportedException {
MyNumber myObj = super.clone();
myObj.numbers = (int[]) numbers.clone();
return myObj;
}
이부분에서 캐스팅하는 이유가 궁금합니다. 그냥 numbers.clone() 하면 int[] 데이터타입이 복사가 안되서 해주는건가요?
되서->돼서
모르겠읍니다만궁금하지도안읍니다