Search code examples
javascopefinallocal-variables

Why can't variables local to a method be declared final?


I like to know why Variables that are local to a method cannot be declared final. Is there any specific reason?

Does it mean are there no local constants in Java?


Solution

  • They can be declared final. Your actual problem lies somewhere else.