Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
return keyword
:
Content language: 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
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes