Advanced Java Programming - Old Questions
10. Discuss any 5 exception classes in java.
5 marks
|
Asked in 2070
Given below is a list of the exceptions classes:
- ArithmeticException: It is thrown when an exceptional condition has occurred in an arithmetic operation like divide by zero.
- ArrayIndexOutOfBoundsException: It is thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.
- ClassNotFoundException: This Exception is raised when we try to access a class whose definition is not found.
- FileNotFoundException: This Exception is raised when a file is not accessible or does not open.
- IOException: It is thrown when an input-output operation failed or interrupted.
Example of Arithmetic Exception: