When a variable is declared inside a Method it is known as Method Local Variable.The scope of local variables is only inside the Method, which means local variables cannot be accessed outside that Method.There are some restrictions on access modifier that can be applied on local variables.
What is class variable(static variable) in java?
In how many ways we can access static fields(variables or methods) in java?
What is instance variable in java?
How many type of variables available in java,mention them?
What is the difference between protected and default(no specifier) access modifier?