public class LARewardPunishSchema implements Schema, Cloneable
{
public Object clone()
throws CloneNotSupportedException
{
LARewardPunishSchema cloned = (LARewardPunishSchema)super.clone();
cloned.fDate = (FDate) fDate.clone();
cloned.mErrors = (CErrors) mErrors.clone();
return cloned;
}
}其中,第六行的super是什么意思啊?
{
public Object clone()
throws CloneNotSupportedException
{
LARewardPunishSchema cloned = (LARewardPunishSchema)super.clone();
cloned.fDate = (FDate) fDate.clone();
cloned.mErrors = (CErrors) mErrors.clone();
return cloned;
}
}其中,第六行的super是什么意思啊?
个人认为,super.clone()是为了实现深层拷贝。
但是觉得该例用得有些怪异=。=
是不是发错板块了?
super有两种通用形式,第一种是调用父类的构造函数.第二种是用来访问被子类的成员覆盖的父类成员.
但是super()必须是在子类构造函数中的第一个执行语句