What is the output of the following program?
public class Main { static int i = 1, j = 2; static {/*from www . j a va2 s . c om*/ display(i); } public static void main(String[] args) { display(j); } static void display(int n) { System.out.print(n); } }
C.
The static initializer is executed followed by main()
.