Mutability and Java 8's method references

March 12, 2018

Method references is a nice feature introduced in Java 8. It lets you make your lambdas even more concise: // from... someStream .map(item -> obj.someMethod(item)) .moreStuff... // to... someStream .map(obj::someMethod) .moreStuff... Some linting tools will even suggest you replace your lambdas with method references but, watch out, that sometimes have some unadverted consequences. For instance, this is a piece of actual code I was working one: private List<Application> applications() { return applications . ... Read more

© 2017 | Powered by Hugo ♥ | Art by Clip Art ETC