/*
方法重写的注意事项:
A:父类中私有方法不能被重写
因为父类私有方法子类根本就无法继承
B:子类重写父类方法时,访问权限不能更低
最好一致
C:父类静态方法,子类也必须通过静态方法进行重写
其实这个算不上方法重写,但是现像如此,至于为什么算不上方法重写,多态中理解

子类重写父类的时候,最好声明一模一样
*/
class Father{
//private void show(){}

/*
public void show(){
System.out.println("show Father");
}
*/

void show(){
System.out.println("show Father");
}

/*
public static void mathod(){

}
*/

public void mathod(){

}
}

class Son extends Father{
//private void show(){}

/*
public void show(){
System.out.println("show Son");
}
*/

public void show(){
System.out.println("show Son");
}


public static void mathod(){

}

/*
public void mathod(){
//Son 中的 mathod() 无法覆盖 Father 中的 mathod();被覆盖的方法为 static
//public void mathod(){
//1 错误

}
*/


}

class ExtendsDemo10{
public static void main(String[] args){
//创建对象
Son s = new Son();
s.show();
}
}