Computer Science, asked by sakusa, 3 months ago

Explain local and global scope of a variable with example.
ICSE 10 java

Answers

Answered by babygirl91
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 vanshikamanki150709
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