I was trying to understand the difference between forEach(..) method in java8 and forEach loop in older versions. As per my knowledge ConcurrentModificationException will not generate even when we use forEach loop from java5, so is there any performance overcome or any advantage if using forEach(..) method from java8. Please suggest.
1 Answer
I think the similar question has been already answered at
Java 8 Iterable.forEach() vs foreach loop
Please read the article, it has some good points.
1 Comment
akuzminykh
You can mark questions as duplicate by clicking on flag, then a duplicate and then searching for the duplicated.