I want to iterate through an ArrayList in small batch sizes.
For example, if the ArrayList size is 75 and the batch size is 10, I want it to process records 0-10, then 10-20, then 20-30, etc.
I tried this, but it did not work:
int batchSize = 10;
int start = 0;
int end = batchSize;
for(int counter = start ; counter < end ; counter ++)
{
if (start > list.size())
{
System.out.println("breaking");
break;
}
System.out.println("counter " + counter);
start = start + batchSize;
end = end + batchSize;
}