I was recently programming and ran into an issue using the ? : operand. Here\'s my code.
Random rand = new Random(); for(int x = 0; x < 3; x++) {
a == 0 ? vertShip(board) : horizShip(board); // is an expression if (a == 0) vertShip(board); else horizShip(board); // is a statement
Compare:
if (condition) { execute statement(s) } else { execute statement(s) }
With:
expression1 ? expression2 : expression3
Use the appropriate construct.