I want iterate in Java trough an increasing number of elements, this the code i was thinking about but I'm not sure about it:
for (int i = 0; i<=maxSomething; i++) {
action(i);
for(String a : ArrayOfString)
otherActions();
}
What i want to do is that:
- i = 0: perform action(0)
- i = 1: perform action(0) and action(1)
- i = 2: perform action(0), action(1) and action(2)
- i<=maxSomething: perform all actions
How can I do this?