+ 1
Why are some variables declared outside the class and others in the block of code known as void main()?
why do some variable become declared outside of the class and some with the block of code of the void main()?
1 Respuesta
+ 1
Because the variables outside are global variables and you have access in the whole class of them.
The variables in the block are local variables and you have only access in the block.