今天看的晕了 谁给我好好解释下执行的顺序
class Phone
{
public void call(String name)
{
System.out.println("给"+name+"打电话");
}
}
class NewPhone extends Phone
{
public void call(String name)
{
super.call(name);
System.out.println("今晚一起数月亮");
}
}
class Demo
{
public static void main(String[] args)
{
NewPhone np=new NewPhone();
np.call("张学友");
}
}
|
|