Instantly share code, notes, and snippets.

@benjholla /Puzzle10.java Secret
Last active Sep 21, 2018

Embed
What would you like to do?
Java Puzzle 10 (spot the bug if one exists)
public class Puzzle10 {
public static void main(String[] args) {
((Puzzle10) null).print();
}
private static void print() {
System.out.println("Hello World!");
}
}
@benjholla

This comment has been minimized.

Show comment
Hide comment
@benjholla

benjholla Sep 21, 2018

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

Owner

benjholla commented Sep 21, 2018

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

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