Skip to content

Instantly share code, notes, and snippets.

@kenorb
Created July 23, 2014 18:36
Show Gist options
  • Save kenorb/5c6d4780787dea86d924 to your computer and use it in GitHub Desktop.
Save kenorb/5c6d4780787dea86d924 to your computer and use it in GitHub Desktop.
UnreportedException Demo
/*
* UnreportedException Demo
*
* Usage:
* javac UnreportedExceptionDemo.java
* java UnreportedExceptionDemo
*/
class UnreportedExceptionDemo {
public static void main(String[] args) throws ClassNotFoundException {
// public static void main(String[] args) { // error: unreported exception ClassNotFoundException; must be caught or declared to be thrown
throw new ClassNotFoundException("Class is not found!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment