Skip to content

Instantly share code, notes, and snippets.

@jbgi
Created February 10, 2016 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbgi/c60acbfd7870237d0de6 to your computer and use it in GitHub Desktop.
Save jbgi/c60acbfd7870237d0de6 to your computer and use it in GitHub Desktop.
public class Example {
private int value;
public int totallyComplexForSure(int x) {
final int result;
if (x <= 0) {
result = 0;
} else if (x == 10) {
result = -value;
} else {
result = value + 10;
}
return result;
}
public int lookMaNoLocalVariable(int x) {
return x <= 0 ? 0
: x == 10 ? -value
: value + 10;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment