Class IndexOutOfboundException in Java
IndexOutOfboundException object is thrown to indicate that an index (or some sort of ) is out of its allowed range or bounds. This applies to Array, Vector or a String. An application can subclass this class to indicate a similar kind of exception.
Two subclasses of the IndexOutOfboundException areas:
The structure of the class IndexOutOfboundException is as follows:
public class java.lang.IndexOutOfboundException extends java.lang.RuntimeException{
//constructor
public IndexOutOfboundException();//constructs an empty IndexOutOfboundException object that is an object with no message specified.
public IndexOutOfboundException(String message); //constructs an IndexOutOfboundException object with the message specified.
}
The class IndexOutOfboundException also inherits methods from class Object and Throwable.
From Object class | From Throwable class |
---|---|
clone() | fillInStackTrace() |
getClass() | getMessage() |
notify() | printStackTrace() |
wait() | printStackTrace(PrintWriter) |
wait(long, int) | getLocalizedMessage() |
wait(long) | printStackTrace(PrintStream) |
equals(Object) | |
toString() | |
finalize() | |
hashCode() | |
notifyAll() |