Wednesday, 21 April 2021

Java: forEachRemaining() method

The forEachRemaining() method is introduced in java 8 itself. This method makes iteration on iterator very easy. Basically, this method uses a lambda expression and reduces a lot of unnecessary code. Check below example,




No comments:

Post a Comment