
7.12 Errors and Exceptions in Java and Multithreaded Programming
System.out.println(e.getMessage());}
}// end of main
}// end of class MyException
OUTPUT: Enter id number of Employee 50596
Enter Transaction amount:25000.00
Bank balance5000.0 Transaction Amount 25000.0
Inside catch block - Our Own Exception
Sorry Transaction cannot be processed Bal<1000.00
7.7.4 Re-throwing of an Exception
Suppose an exception occurs at some method but the corrective mechanism is placed at some
other method, say main()method, then the exception caught by catch block of called method
can re-thrown, so that main() will catch the re-thrown exception and carries out correcting ...