Multiple choice technology programming languages

package staticinit; public class TestStaticInit { { System.out.print("I am in Init "); } TestStaticInit() { System.out.print("Constructor "); } static { System.out.print("I am in Static "); } static { System.out.print("I am in Static1 "); } public static void main(String[] args) { System.out.println("Before calling "); TestStaticInit init = new TestStaticInit(); TestStaticInit init1 = new TestStaticInit(); } }

  1. I am in Static. I am in Static1. Before calling. I am in Init. Constructor. I am in Init. Constructor.

  2. Before calling. I am in Static. I am in Static1. I am in Init. Constructor. I am in Init.Constructor.

  3. Before calling. I am in Static. I am in Static1. Constructor. I am in Init. Constructor. I am in Init.

  4. Before calling. Constructor. I am in Static. I am in Static1. I am in Init. Constructor. I am in Init.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Static initialization blocks execute first when the class loads, in the order they appear. Then the main method executes. When objects are created with 'new', instance initialization blocks execute before the constructor. Static blocks run only once per class load, not per object creation.