Originally posted by yogi maheshnath:
... Please Explain more.I am not getting it.
An instance of a local class can continue to exist after the method exits. But when a method exits, local variables are destroyed. So if the instance tried to read one of those local variables after the method has exited, there would be a problem. However, if the local variable is final, then its value will not change, and so that value can be copied into the instance as a constant. That way, the local variable does not need to be read again after the instance is created.