public class MainClass {
public static void main(String[] arg) {
float[][] samples = new float[6][]; // Define 6 elements,
// each is an array
for (int i = 0; i < samples.length; i++) {
samples[i] = new float[i + 1]; // Allocate each array
}
for (int i = 0; i < samples.length; i++) {
System.out.println(samples[i].length);
}
}
}
|