問題文
A class contains a static initializer block, an instance initializer block, and a constructor body that assigns a field. In which order do the three run while the first instance of that class is being created?
選択肢
- The instance block runs ahead of the static block for the first object, since instance state has to exist before class state is set up
- The constructor body runs first as the entry point of creation, then the instance block runs, and the static block runs when the object is discarded
- The static block runs once while the class is initialized, then the instance block runs, and the constructor body runs after it for every new instance
- The static block and the instance block both run once per instance, and the constructor body runs between those two blocks