Created
April 30, 2016 15:08
-
-
Save d-smith/d8343723f6b732e39621ce8189090c98 to your computer and use it in GitHub Desktop.
Lambda Expressions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Executed at http://www.tutorialspoint.com/compile_java8_online.php | |
public class HelloWorld{ | |
public static void main(String []args){ | |
System.out.println("Hello World"); | |
java.util.function.Function<Integer,Integer> times2 = (Integer x) -> 2*x; | |
java.util.function.Function<Integer,java.util.function.Function<Integer,Integer>> timesN = x -> y -> x * y; | |
System.out.println(times2.apply(2)); | |
System.out.println(timesN.apply(2).apply(3)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment