| 13 | } |
| 14 | |
| 15 | public class ExceptThrow { |
| 16 | public static void main(String[] args) { |
| 17 | try { |
| 18 | // throw new ArithmeticException("Hello"); // "Hello" is a parameter |
| 19 | t obj = new t(); |
| 20 | } |
| 21 | // catch(ArithmeticException e) { |
| 22 | // System.out.println(e.getMessage()); |
| 23 | // } |
| 24 | catch(NullPointerException e) { |
| 25 | System.out.println(e.getMessage()); |
| 26 | // e.getLocalizedMessage() and e.getMessage() prints out the same output currently |
| 27 | System.out.println("Recaught!"); |
| 28 | } |
| 29 | finally { |
| 30 | System.out.println("Finally block will always be executed!"); |
| 31 | } |
| 32 | } |
| 33 | } |
nothing calls this directly
no outgoing calls
no test coverage detected