πŸ“Š JAVA
Q. What is the output of the code snippet with the ternary operator?
Code:
int p=5;
System.out.print("Hello ");
(p<6)?5:6;
  • (A) Hello 5
  • (B) Hello 6
  • (C) Hello
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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