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.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести