V

Vijay Sangwan • 28.62K Points
Instructor II

Q. What will be the output of the following Java code?

Code:
class ternary_operator
{
public static void main(String args[])
{
int x = 3;
int y = ~ x;
int z;
z = x > y ? x : y;
System.out.print(z);
}
}
  • (A) 0
  • (B) Break halts the execution and forces the control out of the loop
  • (C) 3
  • (D) -4
  • Correct Answer - Option(C)
  • Views: 54
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics