Class IndexOutOfboundException in Java

Class IndexOutOfboundException in Java IndexOutOfboundException object is thrown to indicate that an index (or some sort…