+ 3

Sololearners plz share something which you think you knows but not many others know. (JAVA)

someday back i have encountered a statement (a==b)?22:33; and dont know what it meant fortunately i got know what it meant but i m pretty sure that there are many other things which might not be known by others including me plz share them if u know any. ONLY FOR JAVA

19th Apr 2017, 11:50 AM
shobhit
shobhit - avatar
3 Antworten
19th Apr 2017, 12:24 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 6
Max=(a>b)?a:b; These are known as ternary operators in java.They are basically like a short form of your conditional statements. like if(a>b) { max =a; else max=b; }
19th Apr 2017, 12:14 PM
Manideep
Manideep - avatar
+ 2
https://code.sololearn.com/cZdi0F3nCthA/?ref=app i guess this. when i first saw it i was so confused
19th Apr 2017, 1:32 PM
Edward