java function throw exception code example
Example 1: js throw error
throw new Error('Whoops!')
Example 2: exceptions in java
Unchecked:
-IndexOutOfBounds exception(while working with arrays/strings)
-NullPointerException(if I forget to instantiate the objects)
-ArithmaticException
Checked:
-IOException
-SQLException
-FileNotFountException