I would like to ask all the great gods the execution order of the following code. I have been wondering what the execution order is. I hope there will be a big boss to give me an answer. Thank you very much ~
public class ExeOrder1 {
public static int k=0;
public static ExeOrder1 e1 = new ExeOrder1("t1");
public static ExeOrder1 e2 = new ExeOrder1("t2");
public static int i = print("i");
public static int n=99;
public int j=print("j");
{
print("");
}
static{
print("");
}
public ExeOrder1(String str){
System.out.println((PPk)+":"+str+" i="+i+" n="+n);
PPi;
PPn;
}
public static int print(String str){
System.out.println((PPk)+":"+str+" i="+i+" n="+n);
PPn;
return PPi;
}
public static void main(String[] args){
ExeOrder1 e=new ExeOrder1("init");
}
}
the following is the result of the run:
1
2: building block item1
3:t1 item2
4 br > 4 viz. 3 nude 3
5: building block 4 naphtha 4
6:t2 iota 5
7 br iota 6 naphtha 6
8: static block iport 7 naphtha 99
9J iprit 8 nude 100
, the following is the result of the operation:
4
4
5: the following is the result of the run:
1
2: block iota 1
2
4
5: block 4
5
7
8: static block