Question: What does the following output? A. block B. constructor C. instance D. The code does not compile. E. None of the above. 1: public class
What does the following output?

A. block
B. constructor
C. instance
D. The code does not compile.
E. None of the above.
1: public class InitOrder public String first public InitOrder () { 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:} = "instance"; first = "constructor"; } { first = "block"; } public void print() { System.out.println(first); } public static void main(String... args) { new InitOrder ().print(); }
Step by Step Solution
3.33 Rating (156 Votes )
There are 3 Steps involved in it
The provided Java code is designed to demonstrate the order of initialization blocks both instance a... View full answer
Get step-by-step solutions from verified subject matter experts
