Last active
August 29, 2015 14:03
-
-
Save yuki-takeichi/3516f4f376b5c699529d to your computer and use it in GitHub Desktop.
Exception compile error (2)
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
package exn; | |
import exn.SubClassException; | |
public class Main { | |
public Main() {} | |
public static void main(String args[]) { | |
Main main = new Main(); | |
try { | |
try { | |
main.doProcessThatMayFail(); // no compile error | |
} catch(SubClassException e) { | |
System.out.println("subclass exception!"); | |
} | |
} catch(Exception e) { | |
System.out.println("exception!"); | |
} | |
} | |
public void doProcessThatMayFail() throws Exception {// this may throw SubClassException POTENTIALLY | |
throw new Exception(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment