What will print the following code?

public class Quizful {
    static {
        System.out.println("Bo-Bo!");
    }

    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }

static {
        System.out.println("Go-Go!");
        System.exit(0);
    } 
}
Explanation
Static initialization blocks are executed in order of declaration. System.exit(0) terminates the program, status code 0 passed as a parameter means that program exited without errors.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes