这段java代码有错吗?--关于重写的权限
街角祝福 2011-08-25 09:04:37 class Box
{
int i;
int j;
Box()
{
i = 10;
j = 10;
}
public void show()
{
System.out.println( i+"\t"+j );
}
}
class wBox extends Box
{
int weight = 50;
wBox()
{
super();
}
protected void show()
{
System.out.println( i+"\t"+j+"\t"+weight );
}
}
public class t1
{
public static void main(String args[])
{
wBox mybox = new wBox();
mybox.show();
}
}