public class Practice {
protect String toString()
{
return super.toString();
}
}这样写有 java-Cannot reduce the visibility of the inherited method from 父类
原因是子类重写父类方法 权限修饰范围必须大于父类的范围
把修饰符改为public 就对了
public String toString()
{
return super.toString();
}
这样写就对了
1368

被折叠的 条评论
为什么被折叠?



