Q. What is the output of the Java code snippet below?

Code:
int a = 4, b=7;
int result = (true?a&b:a|b)>3?120:150;
System.out.println(result);
  • (A) 4
  • (B) 120
  • (C) 150
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 120

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
399
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
91%
Success Rate