Created
June 17, 2013 23:50
-
-
Save dragonfax/5801540 to your computer and use it in GitHub Desktop.
Throw a checked exception with no fucks given (no declaring the checked exception).
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
class NoFucks { | |
public NoFucks () throws Exception { | |
throw new Exception(); | |
} | |
} | |
... | |
try { | |
NoFucks.class.newInstance(); | |
} catch(InstantiationException e) { | |
} catch(IllegalAccessException e) { | |
} | |
// never gets here. Exception is thrown. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment