Created
November 28, 2014 08:17
-
-
Save WonderCsabo/b600f0a487f8b7033ff4 to your computer and use it in GitHub Desktop.
Java can be tricky, too :)
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
public class Main { | |
public static class Hello { | |
void fun() throws NullPointerException { | |
} | |
} | |
public static class Hello2 extends Hello { | |
@Override | |
void fun() throws RuntimeException { | |
throw new ArithmeticException(); | |
} | |
} | |
public static void main(String[] args) { | |
Hello hello = new Hello2(); | |
try { | |
hello.fun(); | |
} catch (NullPointerException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment