This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Array" Watch "Array" New topic
Author

Array

Frantz Fleury
Greenhorn

Joined: Jan 30, 2004
Posts: 1
while running a java program, I got this error message:
ArrayIndexOutOfBoundsException.
Can you help?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hi,
Welcome to JavaRanch!
I'm moving this to our Java beginner's forum.


[Jess in Action][AskingGoodQuestions]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Given an array with N elements, you can use an index ranging from 0 to N-1. Using any other index value with the array will give an ArrayIndexOutOfBoundsException.
 
 
subject: Array