static object in

Posted by Kanagase under C# on 10/3/2012 | Points: 10 | Views : 761 | Status : [Member] | Replies : 1
why we are using static object in,what are the advantages in it


Posted by: Bageshkumarbagi on: 10/5/2012 [Member] Starter | Points: 25

Static Class

Static classes and class members are used to create data and functions that can be accessed without creating an instance of the class. Static class members can be used to separate data and behavior that is independent of any object identity: the data and functions do not change regardless of what happens to the object. Static classes can be used when there is no data or behavior in the class that depends on object identity.

static class CompanyInfo
public static string GetCompanyName() { return "CompanyName"; }
public static string GetCompanyAddress() { return "CompanyAddress"; }

Bagesh Kumar Singh
Mark as answer if you have been satisfied

Kanagase, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response