Hi Friends......
I want to know, how many create instance of static class ? Please explain ?
Thanks......
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Feb 6, 2012, 10:48 PM
A class can be declared static, indicating that it contains only static members. It is not possible to create instances of a static class using the new keyword. Static classes are loaded automatically by the .NET Framework common language runtime (CLR) when the program or namespace containing the class is loaded.
Static classes are sealed and therefore cannot be inherited. Static classes cannot contain a constructor, although it is still possible to declare a static constructor to assign initial values or set up some static state.
Vinnet, Is there any special requirement to doing this??
hope this help.
VulpesPosted Feb 6, 2012, 10:58 AM
It is just designed to be a container for a bunch of related static members. System.Math in the .NET Framework is a good example of one:
http://msdn.microsoft.com/en-us/library/system.math.aspx