Skip to content
Advertisement

Tag: lambda

Java 8 lambda (from javascript example)

I’m learning java from javascript background, and I wonder is it possible to write similar function in Java. Here is an example in javascript: Where getPrice1 and getPrice2 are previously defined functions. Use of calbacks here helps to keep code short. Im not sure is it possible in Java to pass function as argument without declaring additional interfaces. I asked

Advertisement