Use of final local variables in java [duplicate]
This question already has an answer here: Why would one mark local variables and method parameters as “final” in Java? [closed] 12 answers I was wondering is there any usability of using final local variables. Variables are not overridden anyway when inheritance comes into picture. For example a simple code as below public static void main(String args[]) { final String data = "Hello World!"; System.out.println(data); } The example is quite simple one and may not be a relevant code but the question is more generic.I have seen a lot of codes(all incorporated in main function which have final