This is my for loop: for (int i=0; i< 10; i++) { ArrayList row = (ArrayList) results.get(i); Double amount_due = (Double) row.get(0); Double amount_received = (Double) row.get(1); System.out.println("Amount due = " + amount_due); }
I don't get any error, what I want is a better way to end the loop. Because it says to end when it is less than 10. I want to end when the array actually ends. Because I know that there are 10 results, but I know there is a better way to end the loop. Like a method or something, a more professional way to end it, what if there are millions of values?