one line if statement java without else code example Example: shorthand if java without else if(statement1 && statement2) doSomething();