Wednesday 19 August 2015

What is difference between instance Members and Static Members in C#.Net

 A class is a collection of members which can be categorized int two types.
  1. Instance Members
  2. Static Members
Instance Members : 
            Members of a class which do require object of the class for initialization and Execution were know as Instance members.


Static Members  :
          Members of the class which don't require object of the class for initialization and Execution were known as Static members.


Example:


                  int x=100;                         // instance
                  static int y=200;             // static
                  static void Main()
                 {
                  int z =300;                      // static
                  }           
                

No comments:

Post a Comment