Having problems using 2 dimensional arrays. I have something like this:
List<List<String>> pmValues = new ArrayList<List<String>>();
List<String> pmList = new ArrayList<String>();
I want to add values from pmValues based on the index of pmList if it is equal to another value (layerrate):
for (something) {
String layerrate = Something;
String value = Something;
for (int aa = 0; aa < pmList.size(); aa++) {
int abc = aa;
String abc2 = pmList.get(aa);
for (int bb = 0; bb < pmValues.size(); bb++) {
if (layerRate.contentEquals(abc2)) {
pmValues.add(bb, value); --> it doesnt save??? error
}
}
}
}
I need something like this, I ran the code but seems not working as I need to get the index of pmList to use it to save the values from pmValues in the same index as pmList.
pmList: A
pmValues (values): A1, A2, A3, A4
pmList: B
pmValues (values): B1, B2, B3, B4
pmList: C
pmValues (values): C1, C2, C3, C4
Anyone have any idea? ty
List<List<String>>, if you want to map A to A1,A2.. then why not useMap<String, List<String>>