We all use static methods while writing utility classes. The utility methods which we commonly use are Console.WriteLine(), MessageBox.Show() and Math library functions. In .NET v1.1 we can mark a method as a static method so that the method can be accessed using the class reference. As a class can have a mixture of static and non static methods, sometimes this caused problem to the designers with the challenges of educating developers not club static and non static methods in a single class. .NET 2.0 introduced static classes which brings many facilities and solves many of the design problems. Static classes are used when a class needs to contain only static methods and attributes which are not specific to any unique instance. The following are the features of static classes
Tuesday, May 22, 2007
Static Classes in .NET 2.0
Posted by Gopinath M at 1:15 PM
Subscribe to:
Post Comments (Atom)
0 Comments:
Post a Comment