Skip to content

Instantly share code, notes, and snippets.

@whaley
Created September 25, 2011 14:35
Show Gist options
  • Save whaley/1240651 to your computer and use it in GitHub Desktop.
Save whaley/1240651 to your computer and use it in GitHub Desktop.
The problem with the ternary operator in Java
Number n = isTrue() ? Integer.valueOf(1) : Double.valueOf(1.0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment