Removing items from ArrayList in java 8
Removing items from ArrayList in javaΒ 8
As we know ArrayList implementation of List interface store elements in an Array under the hood. Removing elements from ArrayList is a bit costly which is the order of n^2. Letβs say I have a list of integers and I wanna remove all the nonprime number from the list. Typically what we do is, use iterator and while loop to that. We canβt iteration/removing at the time with for each loop, because weβ¦
View On WordPress



















