What is the use of a static variable?

 Posted by Rajni.Shekhar on 4/3/2012 | Category: C# Interview questions | Views: 2520 | Points: 40

Static variable is used for class level variables.
Example: you have a website and you want to count online users.
Take a variable static in login page and increament it when successfully login. it will be updated for all users not specific.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response