Why access specifiers can't be used for variables declared inside method in a Java Class?

Vikram picture Vikram · Aug 6, 2012 · Viewed 7.5k times · Source

Why we can't use access specifiers for variables declared inside method in a Java Class?

Answer

hvgotcodes picture hvgotcodes · Aug 6, 2012

Because it doesn't make sense. Variables declared in a method are local to the method; i.e. they can't be accessed outside the method. What would modifying the variable's declaration achieve?