This file contains hidden or 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
| class Mineral { | |
| } | |
| class Gem extends Mineral { | |
| } | |
| public class Miner { | |
| static int x = 7; | |
| static String s = null; |
This file contains hidden or 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 Test { | |
| static String s = "-"; | |
| public static void main(String[] args) { | |
| try { | |
| throw new Exception(); | |
| } catch (Exception e) { | |
| try { | |
| try { | |
| throw new Exception(); |
This file contains hidden or 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 Test extends Utils { | |
| public static void main(String[] args) { | |
| Utils u = new Test(); | |
| System.out.print(u.getInt(args[0])); | |
| } | |
| int getInt(String arg) { | |
| return Integer.parseInt(arg); | |
| } | |
| } |
This file contains hidden or 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 Test { | |
| static String s = "-"; | |
| public static void main(String[] args) { | |
| new Test().s1(); | |
| System.out.println(s); | |
| } | |
| void s1() { | |
| try { |
This file contains hidden or 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 Test { | |
| public static void main(String[] args) { | |
| String s = "-"; | |
| try { | |
| doMath(args[0]); | |
| s += "t "; // line 6 | |
| } finally { | |
| System.out.println(s += "f "); | |
| } | |
| } |
This file contains hidden or 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
| import java.io.FileNotFoundException; | |
| class Master { | |
| String doFileStuff() throws FileNotFoundException { | |
| return "a"; | |
| } | |
| } | |
| public class Test extends Master { |
This file contains hidden or 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
| class TestException extends Exception { | |
| } | |
| public class Test { | |
| public String sayHello(String name) throws TestException { | |
| if(name == null) { | |
| throw new TestException(); | |
| } | |
This file contains hidden or 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 Test { | |
| static void test() { | |
| try { | |
| String x = null; | |
| System.out.print(x.toString() + " "); | |
| } finally { | |
| System.out.print("finally "); | |
| } | |
| } |
This file contains hidden or 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 Test { | |
| static int[] a; | |
| static { | |
| a[0] = 2; | |
| } | |
| public static void main(String[] args) { | |
| } | |
| } |
This file contains hidden or 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 Test { | |
| public static void main(String[] args) { | |
| try { | |
| // some code here | |
| } catch (NullPointerException e1) { | |
| System.out.print("a"); | |
| } catch (RuntimeException e2) { | |
| System.out.print("b"); | |
| } finally { | |
| System.out.print("c"); |