Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

index out of bounds exception java

// A Common cause index out of bound
public class NewClass2 {
    public static void main(String[] args)
    {
        int ar[] = { 1, 2, 3, 4, 5 };
        for (int i = 0; i <= ar.length; i++)
            System.out.println(ar[i]);
    }
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #index #bounds #exception #java
ADD COMMENT
Topic
Name
1+1 =