My code is:
int count = 0;
contactVisits.keySet().forEach(
key -> {
count++; //cannot reach count here
//.doing my stuff......
// ..
}
);
i need count in lambda, counting with "count" variable but netbeans telling me a problem like "local variables referenced from a lambda expression must be final or effectively final"
Is there a way to get index count of map in Lambda expression or getting a variable outside ?
Mapwhere there's no such thing called index in a map.