class Phone
{
public static void show()
{
System.out.println("number");
}
}
class NewPhone extends Phone
{
public void show()
{
super.show(); //编译时报错???
System.out.println("message");
System.out.println("hehe");
}
}
class Demo5
{
public static void main(String[] args)
{
NewPhone p=new NewPhone();
p.show();
}
}
编译时出错,按理说,非静态调用静态是可以的呀,为什么会报错呢?
|
|