In my class i have to declare a variable. Should i declare it at class lever or method level. and Why? Is their any security reasons in this?
posted 13 years ago
Hi it would be better if ur ? is more specific.Access of a variable depends on it access specifier.If u need the variable in many places means it is better to declare as class variable and if u need in only some specific method means u declare it as method variable/local variable