File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Modern-Java-Examples/src/com/learn/methodreference Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ package com .learn .methodreference ;
2
+
3
+ import java .util .function .Function ;
4
+
5
+ public class FunctionMethodReferenceExample {
6
+
7
+ static Function <String , String > toUpperCaseMethodReference = String ::toUpperCase ;
8
+
9
+ public static void main (String [] args ) {
10
+
11
+ System .out .println (toUpperCaseMethodReference .apply ("java8" ));
12
+ }
13
+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ This repository contains the basic & advance level examples related to Java
5
5
6
6
* [ ImperativeVsDeclarative] ( Modern-Java-Examples/src/com/learn/imperativevsdeclarative )
7
7
* [ Lambdas] ( Modern-Java-Examples/src/com/learn/lambdas )
8
- * [ FunctionalInterface ] ( Modern-Java-Examples/src/com/learn/functionalInterfaces )
8
+ * [ Functional Interface ] ( Modern-Java-Examples/src/com/learn/functionalInterfaces )
9
9
* [ Consumer] ( Modern-Java-Examples/src/com/learn/functionalInterfaces/ConsumerExample.java )
10
10
* [ BiConsumer] ( Modern-Java-Examples/src/com/learn/functionalInterfaces/BiConsumerExample.java )
11
11
* [ Predicate] ( Modern-Java-Examples/src/com/learn/functionalInterfaces/PredicateExample.java )
@@ -16,9 +16,7 @@ This repository contains the basic & advance level examples related to Java
16
16
* [ UnaryOperator] ( Modern-Java-Examples/src/com/learn/functionalInterfaces/UnaryOperatorExample.java )
17
17
* [ BinaryOperator] ( Modern-Java-Examples/src/com/learn/functionalInterfaces/BinaryOperatorExample.java )
18
18
* [ Supplier] ( Modern-Java-Examples/src/com/learn/functionalInterfaces/SupplierExample.java )
19
-
20
-
21
-
19
+ * [ Method Reference] ( Modern-Java-Examples/src/com/learn/methodreference/FunctionMethodReferenceExample.java )
22
20
23
21
24
22
You can’t perform that action at this time.
0 commit comments