Explain local and global scope of a variable with example.
ICSE 10 java
Answers
Answered by
2
Answer:
Global variables are declared outside any function, and they can be accessed (used) on any function in the program. Local variables are declared inside a function, and can be used only inside that function. It is possible to have local variables with the same name in different functions.
Explanation:
hope it helps you
Answered by
0
Answer:
Global variables are declared outside any function, and they can be accessed (used) on any function in the program. Local variables are declared inside a function, and can be used only inside that function. It is possible to have local variables with the same name in different functions.
Explanation:
Similar questions