Professional Documents
Culture Documents
Throw Demo
Throw Demo
* class ThrowDemo { static void display() { try { throw new NullPointerExeption("throw demo"); } catch(NullpointerException e) { System.out.println("exception caught inside display method"); throw e; } } public static void main(String args[]) { try { display(); } catch(NullPointerException e) { System.out.println("re caught:",+e); } }