MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / ExceptThrow

Class ExceptThrow

Programs/excThrow.java:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected