I am new to java. I have 5000 items in a list. I want to loop through the list so that I can get 100 items at a time. I have the following code:
List<ProcessQueueBatch> processQueueBatchList =
Repository.getProcessQueue("Jor");
for (ProcessQueueBatch queueBatch : processQueueBatchList)
{
// do some processing
}
I want to do the processing of first 100 items in the list and then the next 100 items and then again next 100 items until all 5000 items are processed. I have total 5000 items in the list. How can I modify my for loop or list so that I can get 100 items at a time.
any help will be greatly appreciated.
ifcondition to help you seperate the loop.