Mahtab Alam wrote:
The exceptions thrown by API methods like NumberFormatException ,IllegalArgumentException,ArrayIndexOutOfBoundsException are programatically thrown.
Two of them are. ArrayIndexOutOfBoundsException is thrown by the JVM, though, whenever you try to access an array index that doesn't exist.
You
can throw any exception programmatically. But some are only thrown that way - meaning that somewhere in the source code (either yours or an API) there's a statement that says "
throw new ...".