I have a problem with my code, because it throws NullPointerException when I try to assign string from arraylist to array.
String[][] data = new String[idList.size()][];
for(int i = 1; i<=idList.size(); i++) {
data[i][0] = idList.get(i);
data[i][1] = nameList.get(i);
data[i][2] = hList.get(i);
data[i][3] = sList.get(i);
data[i][4] = fList.get(i);
data[i][5] = mList.get(i);
data[i][6] = osList.get(i);
data[i][7] = tsList.get(i);
data[i][8] = podList.get(i);
data[i][9] = pacList.get(i);
}
Can someone please tell me how do I fix that?
data[0]isnull. I suggest you initialise them.