I have class Box, which describes parameters of box (height, width, length):
public class Box {
public int h;
public int w;
public int l;
public Box(int h, int w, int l) {
this.h = h;
this.w = w;
this.l = l;
}
In input i have list of boxes, how to convert it to two dimensional array? One row = one box:
List<Box> listBox1 = new ArrayList<>();
listBox1.add(new Box(12, 11, 12));
listBox1.add(new Box(11, 12, 12));
listBox1.add(new Box(1, 1, 1));
listBox1.add(new Box(67, 34, 13));
Output:
12 11 12 // 1st box and e.t.c...
11 12 12
1 1 1
67 34 13