A variable is a named memory location that can be assigned a value while the program is running. Access to variables depends a great deal on where the variable is first created. This tutorial will focus on variables created inside of a method body or as parameters in the method signature. Variable scope will determine what parts of your program have access to certain variables. In many previous tutorials, I have referred to the area inside of an opening and closing curly brace as the code block. Variables created inside of these code blocks cannot be accessed outside of the code block. Control flow statements like the if and for statements, typically have code blocks directly following the closing parenthesis. Nested code blocks are called inner code blocks. The nested code blocks have access to the variables created in the outer code blocks but not vice versa.
On this page of the site you can watch the video online Learn Java Programming - Introduction to Variable Scope Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Daniel Ross 03 August 2015, share the link with friends and acquaintances, this video has already been watched 864 times on youtube and it was liked by 9 viewers. Enjoy your viewing!