Java – Exception handling

Java  – Exception handling

Exception handling separates the normal processing from the “anomalous” processing. If an error occurs an exception can be thrown to notify that there is a problem, catches the exception and act appropriately, it can log, exit or interact with the user. You must use a try block to catch any exceptions. syntax: try{ statements that may throw an exception } catch (Exception e){ statements that handle the exception. }finally{ statements that will always run regardless of throwing an exception or not } to catch every possible type of error use:…

Java – Exception handling Read More