Search:

Type: Posts; User: Norm

Search: Search took 0.19 seconds.

  1. Re: Error message java.lang.ArrayIndexOutOfBoundsException: 0

    The code needs to test if the length of the args array is > 0. If it is NOT, the code should NOT try to access index 0.
    A couple of solutions if the length < 1
    Print out an error message to the...
  2. Re: Error message java.lang.ArrayIndexOutOfBoundsException: 0

    The indexes for arrays start at 0 and go to the array length-1.
    The first element in an array is at index 0.


    You never posted the full text of the error message that shows what line the error...
  3. Re: Error message java.lang.ArrayIndexOutOfBoundsException: 0

    Test the array's length BEFORE trying to index into the array.


    If the array is not long enough, do NOT try to index into it.
  4. Re: Error message java.lang.ArrayIndexOutOfBoundsException: 0

    The error message says that the array is empty (it does NOT have an element at index 0).
    The code needs to test if the array has one or more elements BEFORE trying to access the first element.
    Use...
Results 1 to 4 of 4