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?
Printable View
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?
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.
Ok i pasted the whole thing
ArrayIndexOutOfBoundsException occurs when you try to access an element of an array that you have not declared
E.g.
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)
@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
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