thanks,<br />gaurav abbi
i got a question like this
System.out.println(5 > 0 ? true ? 2 != 3 : "bar" : 3 <= 6 ? false : 0);
can anybody explain in what all conditions incompatible types will work for ternary operators like this case..
The conditional operator is syntactically right-associative (it groups right-to-left), so that a?b:c?d:e?f:g means the same as a?b : ( c?d : ( e?f:g)).
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
all events occur in real time
By the way, compiling: also Eclipse 3.1 that has a java5 compiler of its own waves the red (white?) flag and says: incompatible operand types. The original compiler from sun works fine.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|