Engineering Full Stack Apps with Java and JavaScript
What will the following program print?
public class InitTest{ public InitTest(){ s1 = sM1("1"); } static String s1 = sM1("a"); String s3 = sM1("2");{ s1 = sM1("3"); } static{ s1 = sM1("b"); } static String s2 = sM1("c"); String s4 = sM1("4"); public static void main(String args[]){ InitTest it = new InitTest(); } private static String sM1(String s){ System.out.println(s); return s; } }
Select 1 option
A. The program will not compile.
B. It will print : a b c 2 3 4 1
C. It will print : 2 3 4 1 a b c
D. It will print : 1 a 2 3 b c 4
E. It will print : 1 a b c 2 3 4