File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/com/winterbe/java8/samples/lambda Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -11,18 +11,22 @@ public class Lambda4 {
1111
1212 void testScopes () {
1313 int num = 1 ;
14-
1514 LambdaToInterface .Converter <Integer , String > stringConverter =
1615 (from ) -> String .valueOf (from + num );
1716
1817 String convert = stringConverter .convert (2 );
1918 System .out .println (convert ); // 3
2019
21- LambdaToInterface .Converter <Integer , String > stringConverter2 = (from ) -> {
20+
21+ LambdaToInterface .Converter <Integer , String > stringConverter2 = (from ) -> {
2222 outerNum = 13 ;
2323 return String .valueOf (from );
2424 };
2525
26+ stringConverter2 .convert (23 );
27+ System .out .println (outerNum );
28+
29+
2630 String [] array = new String [1 ];
2731 LambdaToInterface .Converter <Integer , String > stringConverter3 = (from ) -> {
2832 array [0 ] = "Hi there" ;
You can’t perform that action at this time.
0 commit comments