I have two lists in Java. For one, i want to iterate from the beginning and for the other I want to start from the end. I wanted to use enhanced for loop for this, but i am unsure how to do that. Any suggestions?
No, you cannot use the Enhanced For-Loop to iterate from the end to the beginning of a List. Enhanced For-Loops should be used for simplicity when you wish to step through the elements in a first-to-last order. In any other cases, the "standard" For-Loop is the most optimal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With