Results 1 to 6 of 6
  1. #1
    dharav is offline Member
    Join Date
    Dec 2011
    Posts
    28
    Rep Power
    0

    Default java.lang.ArrayIndexOutOfBoundsException ERROR?

    OK Every Time I can this program it give me this error i cant seem to figure out why?
    Can anyone please help me out?
    Last edited by dharav; 01-15-2012 at 08:30 AM.

  2. #2
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default Re: java.lang.ArrayIndexOutOfBoundsException ERROR?

    Have you initalized that Player array? Hard to tell what is causing the error, perhaps look at the output of the error and look for the line of code it is indicating where the error originated.

  3. #3
    dharav is offline Member
    Join Date
    Dec 2011
    Posts
    28
    Rep Power
    0

    Default Re: java.lang.ArrayIndexOutOfBoundsException ERROR?

    Ok i pasted the whole thing
    Last edited by dharav; 01-15-2012 at 08:21 AM.

  4. #4
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default Re: java.lang.ArrayIndexOutOfBoundsException ERROR?

    ArrayIndexOutOfBoundsException occurs when you try to access an element of an array that you have not declared
    E.g.

    Java Code:
    String myStringArray[] = new String [4];
    myStringArray[4] = "java forums"; // ERROR there is no 4th element ( remember array count begins at 0, so 3 is the last element not 4)

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,730
    Blog Entries
    7
    Rep Power
    21

    Default Re: java.lang.ArrayIndexOutOfBoundsException ERROR?

    @dharav: please don't edit your original post; you removed your question with all its details so now this thread is completely useless to others.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    dharav is offline Member
    Join Date
    Dec 2011
    Posts
    28
    Rep Power
    0

    Default Re: java.lang.ArrayIndexOutOfBoundsException ERROR?

    It was done for a purpose as In school my work will be check on the internet for plagiarism and if any overlaps i will fail so once that is done i will re-edit it. Thx

Similar Threads

  1. Replies: 5
    Last Post: 07-25-2012, 05:11 PM
  2. Replies: 4
    Last Post: 10-02-2011, 09:29 PM
  3. Replies: 1
    Last Post: 09-27-2011, 07:47 PM
  4. Replies: 1
    Last Post: 08-01-2007, 12:47 AM
  5. Replies: 1
    Last Post: 07-25-2007, 11:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •