KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > ArrayIndexOutOfBoundsException


1 /*
2  * @(#)ArrayIndexOutOfBoundsException.java 1.21 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.lang;
9
10 /**
11  * Thrown to indicate that an array has been accessed with an
12  * illegal index. The index is either negative or greater than or
13  * equal to the size of the array.
14  *
15  * @author unascribed
16  * @version 1.21, 12/19/03
17  * @since JDK1.0
18  */

19 public
20 class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException JavaDoc {
21     /**
22      * Constructs an <code>ArrayIndexOutOfBoundsException</code> with no
23      * detail message.
24      */

25     public ArrayIndexOutOfBoundsException() {
26     super();
27     }
28
29     /**
30      * Constructs a new <code>ArrayIndexOutOfBoundsException</code>
31      * class with an argument indicating the illegal index.
32      *
33      * @param index the illegal index.
34      */

35     public ArrayIndexOutOfBoundsException(int index) {
36     super("Array index out of range: " + index);
37     }
38
39     /**
40      * Constructs an <code>ArrayIndexOutOfBoundsException</code> class
41      * with the specified detail message.
42      *
43      * @param s the detail message.
44      */

45     public ArrayIndexOutOfBoundsException(String JavaDoc s) {
46     super(s);
47     }
48 }
49
Popular Tags