The effectively final concept comes in Java 8 as we see the error “local variables referenced from a lambda expression must be final or effectively final”.
Primitive variable values are called effectively final if we don’t re-assign the values after initialization. In the case of objects, if we don’t re-assign the object reference then it’s also called effectively final.
Before Java 8, we have the option to use of anonymous class and to use any local variable in an anonymous class or inner class, the local variable must be final otherwise we have the error “Non-final local variable is accessed from within the inner class; needs to be declared final”.
From Java 8 onwards, we don’t need to use the final keyword for local variables that we going to use in lambda or inner classes or anonymous classes which means these local variables are considered as effectively final.