The array index out of bound exception only checks for the upper limit of your array, so you can check the upper limit of 10 easily. But I dont know if there is something in java which enables us to check the lower limit as well. But if you yourself want to check it, then may be you can write your own exception by extending Exception class.
Originally posted by Saurabh Patil: . . . extending Exception class.
Good idea. Maybe quicker to throw an IllegalArgumentException if the size of the array is outside the requisite range. Use myArray.length in any for loops; that way you can make sure not to exceed the actual size of the array and get an ArrayIndexOutOfBoundsException.