Hello I recently started to learn about streams. I'm having a bit of trouble with understanding how to use a stream to remove specific items from an ArrayList.
I know that I can remove specific items using a line like this
nameList.removeIf(e ->(e.getName().equals(c.getName))));
What I'm having trouble with is using code like this to remove items
nameList.stream()
.filter( e -> (e.getName().equals(c.getName())))
.map(nameList::remove);
I'm not exactly sure what I'm missing or am doing wrong with this code. Any help would be appreciated. Thank you.