Question:What is the output of the given program?
public class Test120 extends _Test120 {
        {
                System.out.print("_INIT");
        }
        static {
                System.out.print("_STATIC");
        }
        Test120() {
                System.out.print("_CONST");
        }
        public static void main(String[] args) {
                System.out.print("_MAIN");
                new Test120();
        }
}
class _Test120 {
        {
                System.out.print("_BIN");
        }
        static {
                System.out.print("_START");
        }
        _Test120() {
                System.out.print("_BASE");
        }
}
 

A _START_STATIC_MAIN_BIN_BASE_INIT_CONST 

B _STATIC_START_MAIN_BIN_BASE_INIT_CONST 

C _STATIC_MAIN_START_BIN_BASE_INIT_CONST 

D _START_MAIN_STATIC_BIN_BASE_INIT_CONST 

+ Answer
+ Report
Total Preview: 583

Copyright © 2024. Powered by Intellect Software Ltd