Skip to content

Instantly share code, notes, and snippets.

@jesboat
Created September 13, 2013 20:55
Show Gist options
  • Save jesboat/6555926 to your computer and use it in GitHub Desktop.
Save jesboat/6555926 to your computer and use it in GitHub Desktop.
Don't try this at home.
public class Eep {
class Foo {
final int bar;
Foo() {
Eep.this.foo = this;
if (true) {
throw new RuntimeException("lolol");
}
bar = 42;
}
}
Foo foo;
public static void main(String[] args) {
Eep e = new Eep();
try {
e.new Foo();
} catch (Exception x) {
/* lolol */;
}
System.out.println("You weren't expecting this, were you? " + e.foo.bar);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment