This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error Question  RSS feed

 
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: 23026
120
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: 23026
120
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!