For your problem, where naming is sequential based on the value of i
, an ArrayList could do the job as you can iterate over it.
However, a more general approach that enables you accessing your arrays by some String name (even if this was random and not sequential as in your case) would be to use a Map<String, float[][]>
, where the key String
of the Map
is the name you have given to your array.
Map<String, float[][]> myMap = new HashMap<String, float[][]>();
for(int i = 0; i < someNumber; ++i)
{
myMap.put("sts" + i, new float[9][9]);
}
then access each array by myMap.get(_aName_);