Тесты
Язык сайта: Русский
Українська
English
Русский
Тесты по программированию
Вход
Регистрация
Тесты по программированию
Теория
сниппеты
Статьи
Главная
Android
Цены
FAQ
История Cosmo
Правила и условия сервиса
Политика конфиденциальности
Политика в отношении файлов cookie
Обратная Связь
return keyword
:
Язык контента: English
Русский
What is the result of the following code execution? public class Main { public static void main(String... args) { System.out.println("" + new Main().summ(3, 3)); } public int summ(int a, int b) { try { return a + b; } finally { if (a == b) return 0; } } }
return keyword
What will be the result of displaying this code? public class Main { static int method() { for (int i = 0; i < 5; i++) { System.out.println("i = " + i); try { if (i == 1) { throw new Exception(); } } catch (Exception e) { System.out.println("Exception!"); return i; } finally { System.out.println("Finally block"); } } return -1; } public static void main(String[] args) { System.out.println("method() returned " + method()); } }
return keyword
← Предыдущая
1
Следующая →
Зарегистрируйся сейчас
или
Подпишись на будущие тесты