Note that there are some explanatory texts on larger screens.

plurals
  1. POI need to know how to fill an arrays indexes with other arrays
    text
    copied!<p>i want to create an array of 5 indexes, which will have an index with another whole array in each one. each array within the 5 index will need to be as many indexes as follows (10, 100,1000,10000) but i dont know how to fill an array like this inside of my for loop ,that is typically used with an array, without it running into infinity, because where i have for(int x = 0; x &lt; array.length; x++), i cant use the x variable in here; int[x&lt;--(syntax error)] array = {ten = new int[arraySize], hundred = new int[arraySize], thousand = new int[arraySize], tenthousand = new int[arraySize], without it telling me there is a syntax error . i don't know what to do.</p> <p>all this code is part of a method of its own class as well if that helps understand better.</p> <p>public int ArrayArray(int arraySize, int randomNumber) {</p> <pre><code> arraySizes = arraySize; for(int x = 0; x &lt; array.length; x++) { size = 0; Random gen = new Random(randomNumber); int[]ten; ten = new int[arraySize]; int[] hundred; hundred = new int[arraySize]; int[]thousand; thousand = new int[arraySize]; int[]tenThousand; tenThousand = new int[arraySize]; int[] array = {ten[x] = gen.nextInt(10), hundred[x] = gen.nextInt(100), thousand[x] = gen.nextInt(1000), tenThousand[x] = gen.nextInt(10000)}; return array[]; } </code></pre> <p>this changes my question a little i think ive got it after having worked on it. does this look like it will return what i want it to do? im going to have a driver that i will call this method with a given array size and a given number of random integers.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload