public class Demo1 {
public static void main(String[]agrs)
{
Zi z = new Zi();
z.function();
z.method();
//z.method1();//子类不能继承父类的私有方法
}
}
class Fu
{
private int y = 10;
final int x=9;
final void method() {
System.out.print("hello world");
}
private void method1() {
System.out.print("hello");
}
}
class Zi extends Fu
{
void function() {
System.out.println(x);
//System.out.println(y);不能继承父类的私有属性
}
}