There 5 exception handling keyword, which you will come across very frequently.
5 keyword in java exception handling
- finally finally block can can only exist if try or try-catch block is there, finally block can’t be used alone in java.
Features of finally >
- finally block is always executed irrespective of exception is thrown or not.
- finally is keyword in java.
- finally block is optional in java, we may use it or not.
finally block is not executed in following scenarios >
- finally is not executed when System.exit is called.
RELATED LINKS>