Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 514 Bytes

README.md

File metadata and controls

12 lines (8 loc) · 514 Bytes

MethodReference

Simple example of using method reference with Java 8

The Application.main creates a FirstClass and a SecondClass instances, then call the second.applyFunction with the method first.addPrefix as argument.

Here java.util.function.Function is used as function-type argument: a function with one generic argument and a generic output. Look at java.util.function for other function-type:

http://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html