Scope of Variables in Java Programming

Scope of a variable defines how a specific variable is accessible within the program or across classes. An assigned value to a variable makes sense and becomes usable only when the variable lies within the scope of the part of the program that executes or accesses that variable.


scope-2


Variables are mainly of the following types:



Static Variables
Non-Static Varaiables

Reference: Oracle Official Documentation


The non-static variables are further classified into:



Block Variables
Local Variables
Class...
 •  0 comments  •  flag
Share on Twitter
Published on October 07, 2020 06:51
No comments have been added yet.