Тести
Мова сайту: Українська
Українська
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
Наступна →
Зареєструйся Зараз
або
Підпишись на майбутні тести