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
Зареєструйся Зараз
або Підпишись на майбутні тести