Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

java.lang.IndexOutOfBoundsException: toIndex = 5

  • 01-08-2007 1:00pm
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    java.lang.IndexOutOfBoundsException: toIndex = 5

    What usually causes this error?


Comments

  • Registered Users, Registered Users 2 Posts: 500 ✭✭✭warrenaldo


    you have an array with 5 elements - you try to access the 6th element


  • Closed Accounts Posts: 161 ✭✭nude_hamster


    quinnd6 wrote:
    java.lang.IndexOutOfBoundsException: toIndex = 5

    What usually causes this error?

    an array with 5 elements , has indexes 0-4, an array with 4 elements has indexes 0-3 and so on.... An index of 5 would try to access the 6th element, which is out of bounds to the array.

    you probably have a for loop that doesnt have the correct guard or you are directly trying to access the 6th element of the array, when the array is simply smaller than 6 elements.


Advertisement