chandu <na*************@hotmail.comwrote:
declaring class level variables is good approach or not in c#.
in C++ we used prefer diclaring class level variables more than local
variables.
i had a discussion with somebody that in C# it is disadvantage to diclare
class level variables
so clarify it .
It's a bit like asking whether you should use a file or a database - it
entirely depends on what you're doing. If something is naturally part
of the state of the class, it can't be a local variable. If it isn't
part of the state, it shouldn't be a class variable.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too