Skip to content

Instantly share code, notes, and snippets.

@skyler
Created May 19, 2011 15:35
Show Gist options
  • Save skyler/981053 to your computer and use it in GitHub Desktop.
Save skyler/981053 to your computer and use it in GitHub Desktop.
public class T {
public static void main(String[] args)
{
T t = new T();
try {
throw t.exception;
} catch (IOException ioe) {
System.out.println("caught IO!");
} catch (NumberFormatException nfe) {
System.out.println("caught NumberFormatException!");
} catch (Exception e) {
System.out.println("caught base!");
}
}
public Exception exception;
void testMe()
{
exception = new NumberFormatException("I am an NFE");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment