+ 1
What is the use of '?' sign in java??
4 Answers
+ 25
Ternary Operator?
+ 7
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;
}
+ 2
Check my code.
https://code.sololearn.com/cXS3Bq4sVMhs/?ref=app
+ 1
in a challange i got this question and i got completly confused..
question goes this way
x = x==4?x;2:x%2;