I have come across a class which is non-static, but all the methods and variables are static. Eg:
public class Class1 {
private static string String1 = "one";
private static string String2 = "two";
public static void PrintStrings(string str1, string str2)
{
...
All the variables are static across all instances, so there is no point having separate instances of the class.
Is there any reason to create a class such as this?
Was the class written back in the .NET 1.x days? Static classes didn't appear until C# 2.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With