• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error Question

 
Allan Newman
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this mean?

Exception in thread "main" java.jang.ArrayIndexOutOfBoundsException: 1
at Stats.<init>(Stats.java:64)
at Stats.main(Stats.java:109)

Stats is the name of the program.
 
Henry Wong
author
Sheriff
Posts: 22628
111
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Allan Newman:
What does this mean?

Exception in thread "main" java.jang.ArrayIndexOutOfBoundsException: 1
at Stats.<init>(Stats.java:64)
at Stats.main(Stats.java:109)

Stats is the name of the program.


It means... somewhere around line 64 of the Stats.java file, during construction of a class, it tried to access the index 1 of an array, that does not have an index 1.

Henry
 
Henry Wong
author
Sheriff
Posts: 22628
111
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, without looking at code, we can only guess at the problem. However, here is my guess.

I am guessing that you are trying to access the first and only item of an array, and forgot that arrays are zero based in Java. The first item has an index of zero.

Henry
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!