are you sure it's not
Code:
int hi = 0;
return hi ? 1 : 0;
what i've just written is equivalent to this:
Code:
int hi = 0;
if(hi) return 1;
else return 0;
basically, the code
means "replace this with b is a is true, otherwise, replace this with c"
so you could use
Code:
var1 += (x>2 ? 4 : 1);
to increment var1 by 4 if x is greater than 2, but only by 1 if x is less than or equal to 2.
it's more than just a compact way of doing if statements, as i've illustrated - you can't embed a if statement in an expression, whereas you can embed the ternary operator.