I have an ArrayList named lines. This contains a text file of numerous 0's and 1's split by commas. My issue is trying to convert this arraylist into an integer array. I have tried the following, but am still struggling. What am I missing?
int[][] result = new int [lines.size()][];
for (int i = 0; i<result.length; i++) {
result.add(Integer.valueOf(lines.getString(i)));
}
And
int[][] result = new int [lines.size()][];
for(int i = 0; i<result.length; i++) {
result[i] = Integer.parseInt(lines.get(i));
}