Each catch block is an exception handler and handles the type of exception indicated by its argument. The argument type, ExceptionType, declares the type of exception that the handler can handle and must be the name of a class that inherits from the Throwable class. The handler can refer to the exception with name.
In this code we are handling IndexOutOf BoundsException , Although we are not using any method of this but as it is required by catch so we are passing this argument.
You can use ex to display details of the exception like
catch(IndexOutOf BoundsException ex){
System.out.println(“you forget the passing parameters”);
System.out.println(ex.getMessage());
}
In simple words we have to pass this argument as this is the requirement, this argument will tell compiler that what type of exception that will handle.