I'm new to Java, and I'd like to know how I can insert a 2D array (with elements of course) into an empty 3D array using nested for loops in Java?
String[][][] ProductAllData2 = new String[10][getPInputsWithParameter(getPInputs()).length][getPInputsWithParameter(getPInputs()).length];
String [][] receivedPInputsWithParameter = getPInputsWithParameter(getPInputs());
for(int i = 0; i < ProductAllData2.length; i++) { //Inserts in 3D array
for(int j = 0; j < ProductAllData2[i].length; j++) {
ProductAllData2[i][j] = new String[receivedPInputsWithParameter[j].length];
for(int k = 0; k < ProductAllData2[i][j].length; k++) {
ProductAllData2[i][j][k] = receivedPInputsWithParameter[j][k];
}
}
}