3 ms·
yes, it works the same way with lambdas, the lambda proxy (the class that implements the functional interface) contains the copy of the local values. Here is t
by _old_dude_ 8y ago
yes, it works the same way with lambdas, the lambda proxy (the class that implements the functional interface) contains the copy of the local values.
Here is the code that generate the constructor of a lambda proxy
http://hg.openjdk.java.net/jdk/jdk/file/3cabb47758c9/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java#l356 http://hg.openjdk.java.net/jdk/jdk/file/3cabb47758c9/src/jav...