dinesh19aug / javahabit-comments

0 stars 0 forks source link

Understanding Java 8 Lambda final finally variable #7

Open dinesh19aug opened 4 years ago

dinesh19aug commented 4 years ago

https://www.javahabit.com/2016/06/16/understanding-java-8-lambda-final-finally-variable/

I am a little late to the java 8 party and was trying to quickly get some hands on with lambdas and ran into an issue where I got the error message Variables used in lambda should be final or effectively final  . I know what final is but what is effectively final. Here is what I was trying to do. I had a HashMap which had values like “one : 1”, “two : 2”, “three : 3” and wanted to replace the String ${one} with 1 etc.