0
What does it mean exactly that only one instance of a static cass can exist in a program?
3 Respostas
+ 1
As far as I know you can not create an instance of a static class.
Static classes do not contain any instance member properties or functions. So to make an instance would be pointless.
+ 1
Essentially a static class is a class you cannot instantiate, meaning you cannot use the 'new' keyword to create it.
An example of a static class is the System.Math class
int result = Math.Min(10, 5);
A class like this is typically referred to as a Utility class.
"Static Classes and Static Class Members (C# Programming Guide)" : https://msdn.microsoft.com/en-us/library/79b3xss3.aspx
0
thank you!