Method References in Java


Method references provide a way to refer to methods by their names. A method reference is described using “::” syntax.

Source Code

List list = Arrays.asList("Apple", "Banana", "Cherry");
list.forEach(System.out::println);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments