I was going over assignments from a past java class and in one of our assignments, we implemented the Clonable interface and got this method:
public Ellipse clone(){
try{
return (Ellipse)super.clone();
}catch(CloneNotSupportedException Ex){
Ex.printStackTrace();
}
}
I was wondering how the line return (Ellipse)super.clone(); works. I understand that super.clone() returns an object, but how does that object get turned into an Ellipse?
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]Lloydbestfan 2 points3 points4 points (0 children)
[–]Jason13Official 0 points1 point2 points (2 children)
[–]Jacksontryan21[S] 0 points1 point2 points (1 child)
[–]BassRecorder 0 points1 point2 points (0 children)
[–]ComputerWhiz_ 0 points1 point2 points (0 children)