I have an ArrayList of Strings, size of which may vary.
List<String> strList1 = new ArrayList<String>();
For each of the Strings, I am calling a method updateDetails(strList1), which processes it and prints an op based on some logic.
I would like to call the above method updateDetails(strList1) for the first string, then for 5 (including first 1) etc in fixed intervals as below
The intervals are 1, 5, 10, 50, 100, 200, 1000
The o/p (if strList1 size is 25) should be something like:
Result for first 1:
Result for first 5:..
Result for first 10:..
Result for total 25 :
The o/p (if strList1 size is 9) should be something like:
Result for first 1:..
Result for first 5:..
Result for total 9:..
How to go about it?
You can avoid duplicates with
If duplicates are not a problem.