We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86a05b6 commit 7456de4Copy full SHA for 7456de4
java8Tutorials/src/main/java/java8/functionalInterface/FunctionInterfaceDemo1.java
@@ -0,0 +1,21 @@
1
+package java8.functionalInterface;
2
+
3
+import java.util.function.Function;
4
+/**
5
+ *
6
+ * @author saurav
7
8
+ */
9
+public class FunctionInterfaceDemo1
10
+{
11
+ public static Integer show(String message){
12
+ return Integer.parseInt(message);
13
+ }
14
+ public static void main(String[] args)
15
+ {
16
+ // Function interface referring to a method
17
+ Function<String, Integer> fun = FunctionInterfaceDemo1::show;
18
+ // Calling Function interface method
19
+ System.out.println(fun.apply("4545")); // output : 4545
20
21
+}
0 commit comments