Answer:
It's a compact way of doing an if-else statement.
General Format is
<condition> ? <if condition is true> : <else>;
Example:
I could rewrite:
if(a==1) temp = 1;
else temp = 999;
as
temp = (a==1) ? 1 : 999;
7.2m questions
9.6m answers