C#: why have all static methods/variables in a non-static class?
Posted
by Craig Johnston
on Stack Overflow
See other posts from Stack Overflow
or by Craig Johnston
Published on 2010-04-28T11:00:55Z
Indexed on
2010/04/28
11:13 UTC
Read the original article
Hit count: 248
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?
© Stack Overflow or respective owner