What is static in C#.?
June 20, 2011 2:28am CST
I know the definitions it is modifier used in method, properties..etc but the definitions of it doesn't resolve my query actually what the use of it in the method..so friend can you tell me in easier way what actually it is ..?
21 Jun 11
In C, a variable declared as static in a function is initialised once, and retains its value between function calls. The default initial value of an uninitialized static variable is zero. If a function or global variable is declared static, it can only be accessed in that file. Read more: http://wiki.answers.com/Q/What_is_a_static_identifier_in_C#ixzz1PwMJkyfS also read: http://en.wikipedia.org/wiki/Static_variable
20 Jun 11
A static object is one which only has one copy, no matter how much instances the class it is declared in has. For example: ClassA contains StaticB I create InstanceA, InstanceB and InstanceC as instances of ClassA. If I InstanceA.StaticB = 100, InstanceB.StaticB InstanceC.StaticB and will be 100 as well.