I have a problem to declare a mulitple arraylist. ... missing the correct syntax or mixed up my mind ...
This works fine till here, to declare an arraylist with an array:
Integer[] arrArray = new Integer[] {1,2,3,4,5};
ArrayList<Integer> arrList = new ArrayList<Integer>();
arrList.addAll(Arrays.asList(arrArray));
also initailising and declaring in one line :
Integer[] arrArray = new Integer[] {1,2,3,4,5};
ArrayList<Integer> arrList = new ArrayList<Integer>(){{
addAll(Arrays.asList(arrArray));}};
or by element :
ArrayList<Integer> arrList = new ArrayList<Integer>(){{
add(1);
add(2);
add(3);
}};
But now I would like to do the same thing, but now with multiple dimension arraylists (and Strings in this case):
private String[] arrFUSE={"3", "true", "0", "FUSE"};
private String[] arrPLACE={ "2", "true", "7", "PLACE"};
private ArrayList<ArrayList<String>> arrLIST = new ArrayList<ArrayList<String>>(){{
add( Arrays.asList(arrFUSE) );
add( Arrays.asList(arrPLACE) );
}};
An other try
private ArrayList<ArrayList<String>> arrLIST =
new ArrayList<ArrayList<String>>(){{
add(
new ArrayList<String>(){{ addAll(Arrays.asList(arrFUSE))}};
);
}};
Thanks on beforehand.