Skip to content

Instantly share code, notes, and snippets.


benjholla/ Secret

Created Sep 26, 2018
What would you like to do?
Java Puzzle 11 (spot the bug if one exists)
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();
} catch (Exception e) {
System.out.println("I told you so!");

This comment has been minimized.

Copy link
Owner Author

@benjholla benjholla commented Sep 26, 2018

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

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