What is the shortest way to fill the ArrayList? Something like:
ArrayList<Integer[]> list = new ArrayList<Integer[]>();
list.add({1,10,1,1});
list.add({2,11,1,1});
Or:
ArrayList<Integer[]> list = ({1,10,1,1},{2,11,1,1});
How about this shortcut:
List<int[]> list = Arrays.asList( new int[][]{{1,10,1,1}, {2,11,1,1}} );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With