What will be printed out as the result of the following code execution?

public class Exceptions {
    public static void main(String[] args) {
        try {
            throw new UnsupportedOperationException();
        } catch(Throwable t) {
        } catch(Exception e) {
        } catch(UnsupportedOperationException uoe) {
Code will not compile. All exceptions in java are inherited from Throwable. In a few catch blocks exception handling has to go up the hierarchy of exceptions (in this case from the most specific - UnsupportedOperationException to more general - Throwable, but not vice versa).

Следи за CodeGalaxy

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

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