Where does this forEach
method come from in the following code? It was a suggested fix, and I have not written a forEach method and as far as I can find, List does not implement one either.
List<String> players = Arrays.asList(temp);
//using lambda expression and functional operations
players.forEach(person) -> System.out.print(person + "; "));
How does it know to iterate over the entire list and perform the given lambda expression?