Skip to content

Instantly share code, notes, and snippets.

@benjholla
Created September 12, 2018 15:52
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 benjholla/611daa87ec2608a4629771ea68f1165b to your computer and use it in GitHub Desktop.
Save benjholla/611daa87ec2608a4629771ea68f1165b to your computer and use it in GitHub Desktop.
Java Puzzle 6 (spot the bug if one exists)
public class Puzzle6 {
public static void main(String[] args) {
System.out.println(getResult());
}
private static boolean getResult() {
try {
return true;
} finally {
return false;
}
}
}
@benjholla
Copy link
Author

Adapted from Java Puzzlers: Traps, Pitfalls, and Corner Cases - Puzzle #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment