The normal if statement looks like this
1 2 3 4 5 6 |
int number = 1; if(number == 1) { return true; } else { return false; } |
And a single line if statement looks like this
1 2 |
int number = 1; return (number==1)?true:false; |
And that’s it