is there a lambda function that cannot be a method reference
问题 in a lecture I gave at my company I suggested converting any complex lambda to a method reference (more readable and better debug and testing) and was asked if it is always possible. I searched and could not find a lambda that cannot be replaced with method reference. am I right? (lambda can always be replaced with method reference) 回答1: Method reference cannot capture variables. So a capturing lambda cannot be directly converted to a method reference. For example, int x = 1; numbers