What does '->' do in Java?

Viewed 1436

I was looking at some java tutorials and wasn't sure what '->' did and couldn't find anything on google about it.

Here's some code that I saw that used it:

myShapesCollection.stream()
.filter(e -> e.getColor() == Color.RED)
.forEach(e -> System.out.println(e.getName()));
1 Answers
Related