Static
Why and When do we want use static variable and a static member?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted May 21, 2012, 12:11 AM EDT
Please refer the below links
http://msdn.microsoft.com/en-us/library/79b3xss3%28v=vs.80%29.aspx
http://www.functionx.com/csharp/topics/staticcvariables.htm
http://csharp.net-tutorials.com/classes/static-members/
Thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted May 21, 2012, 1:04 AM EDT
static variables are used when only one copy of the variable is required.
A static variable remains in existence and retains its most recent value. The next time your code calls the procedure, the variable is not reinitialized, and it still holds the latest value you assigned to it. A static variable continues to exist for the lifetime of the class or module in which it is defined.
hope this help.
VulpesRank #55 · 29.2K reputationPosted May 21, 2012, 1:21 AM EDT