Instantly share code, notes, and snippets.

@benjholla /Puzzle7.java Secret
Created Sep 14, 2018

Embed
What would you like to do?
Java Puzzle 7 (spot the bug if one exists)
public class Puzzle7 {
public static void main(String[] args) {
System.out.println(getResult());
}
private static boolean getResult() {
try {
try {
return true;
} finally {
return true;
}
} finally {
return false;
}
}
}
@benjholla

This comment has been minimized.

Owner

benjholla commented Sep 14, 2018

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