DEV Community

Discussion on: Static classes are evil

Collapse
 
scottshipp profile image
scottshipp • Edited

Static methods can also be difficult to test, if they make use of dependencies that are environment-specific.

I would like to point out that the term "static class" has a specific, different meaning in Java. Java developers will usually assume that you are talking about a static nested class if you use that term.

Nice article!

Collapse
 
kspeakman profile image
Kasey Speakman • Edited

Ah. In C#, static is a modifier you can put when declaring a class (top-level or nested). All it does is compile-time verify that all the class members are also static. Otherwise you will get an error. It doesn't have any particular usage implications that I'm aware of.