-
-
Save benjholla/7e885cf6ec8884249612843bef009095 to your computer and use it in GitHub Desktop.
Java Puzzle 11 (spot the bug if one exists)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Puzzle11 { | |
private Puzzle11 internalInstance = new Puzzle11(); | |
public Puzzle11() throws Exception { | |
throw new Exception("I'm not coming out!"); | |
} | |
public static void main(String[] args) { | |
try { | |
Puzzle11 p = new Puzzle11(); | |
System.out.println("Surprise!"); | |
} catch (Exception e) { | |
System.out.println("I told you so!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adapted from Java Puzzlers: Traps, Pitfalls, and Corner Cases - Puzzle #40