package com.lovecoding.day10.ex03;

public class Test1 {
    public static void main(String[] args){
        Son s1 = new Son(); //代码块 构造器 继承重写

    }
}
class Father{
    private int a = getNumber();
    {
        System.out.println("1 Father非静态代码块 a = " + a);
    }
    Father(){
        System.out.println("2 Father()无参构造");
    }
    public int getNumber(){
        System.out.println("3 Father:getNumber()");
        return 1;
    }
}
class Son extends Father{
    {
        System.out.println("4 Son非静态代码");
    }
    public Son(){
        //super();
        System.out.println("5 Son()：无参构造");
    }
    @Override
    public int getNumber(){
        System.out.println("6 Son:getNumber()");
        return 2;
    }
}
