In the 12th chapter, the Reference object of this in the lambda expression and the recipient of ToString () are from the surrounding environment of the lambda, that is, to see the name of the lambda expression in the category, you can refer to the name within that category, such as a variable or method JDK8 provides a method reference to the characteristics , you can reuse the Bylength method lambda expression is just a way to define the function interface operation, in addition, as long as the method of the static method is signed, the parameter is the same as the return value definition, you can also use a static method to define the function interface operation method reference not only avoids repeating the lambda expression, You can also make the program code clearer that the lambda expression itself is neutral, does not represent any type of instance, and the same lambda expression that can be used to represent object operations of different target types if the local variable captured in the lambda expression is itself equivalent to the final local variable, Instead of adding a FIANLLAMBDA expression to a local variable, you can simply define a way for the function interface operation, except that the parameter is the same as the return value definition in the method signature of the static method. You can also use static methods to define function interface operations in a lambda expression, you cannot change the value of a captured local variable in the JDK, if the variable itself is equivalent to the final local variable, that is, if the variable no longer has a re-specified action in the anonymous class, You don't have to add the final keyword code to the managed script
20165305 Suzhenrong "Java Programming" Eighth Week study summary