Can this method ever throw exception?

public static int getTest() {
    try {
        // arbitrary code here
    } finally {
        return 1;
    }
}
Explanation
If the finally block returns the value from a method or throws an exception, this behaviour always has more priority than behaviour of the corresponding try block. This method always returns 1.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты