Question: What should be the execution order, if a class has a method, static block, instance block, and constructor, as shown below? 1. public class First_c{


What should be the execution order, if a class has a method, static block, instance block, and constructor, as shown below? 1. public class First_c{ 2. public void myMethod 3. { 4. System.out.println("Method"); 5. 6. 7. { 8. System.out.println("Instance Block"); 9. 10. 11. public void First_00 12. { 13. System.out.println("Constructor"); 14. 3 15. static { 16. System.out.println("static block"); 17. 3 18. public static void main(String[] args) { 19. First_cc = new First_c0; 20. cFirst_c0; 21 c.myMethod(); 22. ) 23.) Select one a Static block method. Instance block, and constructor 19. First Cc = new First CO; 20. c.First_CO: 21. c.myMethod: 22. } 23. } Select one: a. Static block, method, instance block, and constructor b. Static block, instance block, constructor, and method Method, constructor, instance block, and static block d. Instance block, method, static block, and constructor Previous page Nex AR
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
