Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 318
  • Given: 11. public static void test(String str) { 12. int ch...

Given: 11. public static void test(String str) { 12. int check = 4; 13. if (check = str.length()) { 14. System.out.print(str.charAt(check -= 1) +“, “); 15. } else { 16. System.out.print(str.charAt(0) + “, “); 17. } 18. } and the invocation: 21. test(”four”); 22. test(”tee”); 23. test(”to”); What is the result?

technology programming languages
  1. r, t, t,

  2. r, e, o,

  3. Compilation fails.

  4. An exception is thrown at runtime.


Show answer
Correct Option: C

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy