Local variables | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Local variables

please explain the difference: • Local variables are visible only within the declared method, constructor or block. • Local variables are implemented at stack level internally.

22nd Jun 2017, 1:47 AM
Việt Hưng Khổng
Việt Hưng Khổng - avatar
1 Answer
+ 1
They're both function of the local variables. It's true that you can't call local variables outside of the block. Accessing them is quite faster because it is implemented at stack level internally.
22nd Jun 2017, 1:53 AM
AJ Carlos
AJ Carlos - avatar