Question
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);
}
}
What is the output of this program?
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);
}
}
Answer: Option C
Was this answer helpful ?
None.
output:
$ javac ternary_operator.java
$ java ternary_operator
3
Was this answer helpful ?
More Questions on This Topic :
Question 10.
Which of these statements are incorrect?
....
Submit Solution