So i currently have :
List<String> lineList = new ArrayList<String>();
String thisLine = reader.readLine();
while (thisLine != null) {
lineList.add(thisLine);
thisLine = reader.readLine();
}
System.out.println(lineList);
Which basically is reading a text file and returning the numbers in the text file.
The output im getting is [0 6 13 0 0 75 33 0 0 0 4 29 21 0 86 0 32 66 0 0]
which seems to be correct. However what I have to do is remove all the zeros without creating a new array. But will i have to convert this string arraylist
to an integer array list to be able to do so? How could I only remove the zeros?
Thanks!