Skip to content

Instantly share code, notes, and snippets.

@yuki-takeichi
Last active August 29, 2015 14:03
Show Gist options
  • Save yuki-takeichi/e21fb26258f8ccc21d11 to your computer and use it in GitHub Desktop.
Save yuki-takeichi/e21fb26258f8ccc21d11 to your computer and use it in GitHub Desktop.
Exception compile error (1)
package exn;
import exn.SubClassException;
public class Main {
public Main() {}
public static void main(String args[]) {
Main main = new Main();
try {
main.doProcessThatMayFail(); // Compile error!
} catch(SubClassException e) {
System.out.println("subclass exception!");
}
}
public void doProcessThatMayFail() throws Exception {
throw new Exception();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment