- 1
Where exactly can I declare variables?
I can declare it whereever I want. Do I understand right?
4 Respostas
+ 5
Yes you can define variable wherever you want but should be in a class. Also scope of variables different. Like if you define your variable outside of any method in class it will global. define inside of method of a class it will local
+ 3
it musst be in class of course :)
+ 1
it must be in that class or object or the functions otherwise it would not work if called from other but if you need to call it from all you can use declaration by global scope
+ 1
thanks