@@ -0,0 +1,655 @@
+%0Apackage net.restlesscoder.sandbox;%0A%0A/** Can you narrow the types of exceptions thrown in a subclass? Yes. */%0Apublic class ThrowException %7B%0A%0A%09public static class FooBase %7B%0A%09%09public void go() throws Exception %7B%7D%0A%09%7D%0A%0A%09public static class MyException extends Exception %7B %7D%0A%0A%09public static class FooExtension extends FooBase %7B%0A%09%09@Override%0A%09%09public void go() throws MyException %7B %7D%0A%09%7D%0A%0A%09public static class FooSubExtension extends FooExtension %7B%0A%09%09@Override%0A%09%09public void go() %7B %7D%0A%09%7D%0A%0A%09public static void main(final String... args) %7B%0A%09%09FooExtension fooExt = new FooSubExtension();%0A%09%09// Unhandled exception type ThrowException.MyException%0A%09%09//fooExt.go();%0A%09%7D%0A%7D%0A

Add a quick test of exception type narrowing