主题:高手帮我解释下这段程序!
public class SequenceTest3 extends Test4{
int i=30;
SequenceTest3(){
print();
i=40;
}
public static void main(String[] args) {
System.out.println(new SequenceTest3().i);
}
void print(){
System.out.println("a "+i);
}
}
class Test4 {
int i=10;
Test4(){
System.out.println("b "+i);
print();
System.out.println("c "+i);
i=20;
}
void print(){
System.out.println("d "+i);
}
}
int i=30;
SequenceTest3(){
print();
i=40;
}
public static void main(String[] args) {
System.out.println(new SequenceTest3().i);
}
void print(){
System.out.println("a "+i);
}
}
class Test4 {
int i=10;
Test4(){
System.out.println("b "+i);
print();
System.out.println("c "+i);
i=20;
}
void print(){
System.out.println("d "+i);
}
}