What are local variables?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What are local variables?
Rating:
Variables declared within blocks (i.e., inside braces) are known as local variables. They are so called because they are not available for use outside the block where they are declared. These variables are temporary variables, which are visible to the program only within the scope of the block. When the program control leaves a block, all the variables in the block cease to exist.
For the same reason, variables declared inside a method are also known as local variables. The scope defined by a method begins with the block that follows the method declaration. If the method has parameters, they too are included within the scope of the method.
Rating:
Was this information helpful?
Other articles
- Things to Practice for CX310-019
- What is the setTransactionIsolation() method?
- What is the setBackground() method?
- What is the Externalizable interface?
- What is the switch statement?