Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-24-2008, 08:30 PM
hallinan hallinan is offline
Newbie
 
Join Date: Jan 2008
Location: Cork Ireland
Posts: 4
Rep Power: 0
hallinan is on a distinguished road
Default project due tomorrow

Hi I'm doing a project in java.It is the game othello.It was all going well till i got an ArrayOutOfBoundsException. the array is this buttons[9][9]; If you dont know othello it's a board game with an 8x8 board.

The Exact error is "ArrayOutOfBoundsException: 9"

attached is the file can anyone help I cant seem to fix this.
Attached Files To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-25-2008, 12:04 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Mod
 
Join Date: Jul 2006
Age: 35
Posts: 1,751
Last Blog:
Game software (GURPS)
Rep Power: 24
WingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to all
Default Re: project due tomorrow

Your indices are going to be 0-8. If you passed a 9 for the index, it will be out of bounds.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-03-2008, 08:40 AM
Xav's Avatar   
Xav Xav is offline
Guru
 
Join Date: Mar 2008
Location: London, England
Posts: 2,969
Last Blog:
Piano Exam
Rep Power: 25
Xav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to allXav is a name known to all
Send a message via MSN to Xav
Default Re: project due tomorrow

Indices always begin at 0, not 1. Therefore, if you declare an array with 9 elements, it will contain the elements 0,1,2,3,4,5,6,7 and 8. NOT 9! If you want 0 - 9, use an array with 10 elements.
__________________
Xav, the power of youth
Worship the Creator... not his creations
Web Site | Beta Site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
VPN project Acheron Technology Ramble 0 03-14-2008 06:06 AM
A cool project idea. AlexanderRybak Community Projects 3 02-11-2008 02:37 AM
FreeOrion (a non commercial, community game project, under development) MikkoM Video Game Talk 2 01-04-2008 12:19 PM
Contributing to a project Jordan Community Projects 7 09-15-2006 04:43 PM
Community Project! - Recent project gone sour Crane C# Programming 5 09-09-2006 02:13 PM


All times are GMT -5. The time now is 03:03 PM.

Contest Stats

John ........ 87.50000
dargueta ........ 75.00000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads