java.lang.ArrayIndexOutOfBoundsException: 0
That error says the array is defined with no elements. There is not an element at index 0;
You need to define the array large enough to hold all the data you want to put into it.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
A [][] array is an array of arrrays. First you need to initialise the first/outer array, then you need to initialise the inner/second arrays, although you can do both at once provided all the inner arrays are the same length egint[][] blocklist = new int[6][3]
Your code just initialised the outer array to have no elements - {} - in which case there are no inner arrays at all. If that array is zero length, then any index will be out opf range.
JamesCherrill
... trying to help
8,512 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30
Yes, only primitives have useful default values.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Question Answered as of 9 Months Ago by
NormR1
and
JamesCherrill