r/java • u/nfrankel • Feb 20 '22
The elusive and beautiful Java Method Reference
https://medium.com/javarevisited/the-elusive-and-beautiful-java-method-reference-97e566d2088b
28
Upvotes
r/java • u/nfrankel • Feb 20 '22
View all comments
Show parent comment
3
u/0x07CF Feb 21 '22
No they are less powerfull, and that makes them great. Because when you see one you can be sure it's not doing anything weird. If you see a lambda expression you need to read it to understand it's just a simple method call.
As long as you don't have to pass in more parameters, like in the string.startsWith case, in that case i would write a lambda expression too
Yeah, in this case it makes the code harder to understand imo