Use ternary operators
if(a==2){some code;}else{some other code;} can be abbreviated to this:
(a==2?some code:some other code); Shorter, huh?
if(a==2){some code;}else{some other code;} can be abbreviated to this:
(a==2?some code:some other code); Shorter, huh?