Q: What is the output of the Java code snippet below? int a = 20, b=30; boolean result = a&b?true:false; System.out.println(result);
Solution: no solution
Q: What is the output of the Java code snippet below? int a = 4, b=7; int result = (true?a&b:a|b)>3?120:150; System.out.println(result);
Solution: no solution
Q: What is the output of Java code snippet below? final int a = 25, b=33; String name = !true?"Dino":"Tom"; System.out.println(name);
Solution: no solution
Q: What is the output of Java code snippet below? int a = 25, b=33; String name = true?"CAT":; System.out.println(name);
Solution: You can not skip any of the two expressions of a Ternary or Conditional operator (?:).
You Have Score    | /4 |