Hi guys,
Would anyone know how to get all values from an ArrayList using a method? I have the following code set up;
public Object getList() { for (int j=0; j < test.listArray[start][end].size(); j++) { return test.listArray[start][end].get(j); } return null; }
This code only returns the first value in the ArrayList as the return null terminates the loop. Is there anyway to get around this?
I know the code does iterate fine because I have tested it with a System.out.println() snippet but I need it to work within a method.