Thanks!
Would you please help me to understand when this level of abstraction is actually useful?
I'm asking because in this example 99% of all java developers would probably just do a
forEach is a defult method of the Iterable interface which uses the java.util.Iterator interface. So, at the end of the day, implicitly is the same. Of course, we do not need to reinvent the wheel. I would use your code.
We're a place where coders share, stay up-to-date and grow their careers.
Thanks!
Would you please help me to understand when this level of abstraction is actually useful?
I'm asking because in this example 99% of all java developers would probably just do a
forEach is a defult method of the Iterable interface which uses the java.util.Iterator interface. So, at the end of the day, implicitly is the same. Of course, we do not need to reinvent the wheel. I would use your code.