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
Зарегистрируйся сейчас
или Подпишись на будущие тесты