class {
public int f = 1;
father(){
show();
}
void show(){
System.out.println("father---"+f);
}
static{
System.out.println("father static block---");
}
{
System.out.println("father block---"+f);
}
}
class son extends {
public int s = 2;
son(){
super();
show();
}
void show(){
System.out.println("son---"+s);
}
static{
System.out.println("son static block---");
}
{
System.out.println("son block---"+s);
}
}
class test{
public static void main(String[] args){
new son();
}
}
近期评论