public class T{
void aMethod(){
System.out.println("this is first method");
}
}public class X extends T{
X(){
aMethod();
}
void aMethod(){
System.out.println("this id second method");
}
}
public class C{
public static void main(String[]args){
new X(); //请问程序执行之后会输出什么?为什么?
}
}
void aMethod(){
System.out.println("this is first method");
}
}public class X extends T{
X(){
aMethod();
}
void aMethod(){
System.out.println("this id second method");
}
}
public class C{
public static void main(String[]args){
new X(); //请问程序执行之后会输出什么?为什么?
}
}
public class X extends T{
X(){
this.aMethod();
}
@Override
void aMethod(){
System.out.println("this id second method");
}
}