I am a fairly experienced C# coder, but new to Java. My question is a general programming question:
- Usually a class which has no internal state (ie fields) is a good candidate for being made static (So doesn't change its reciever class). However, is there ever a reason to make a class holding internal state (fields) a static class? Any examples?
The C# "static class" concept isn't a first-class concept in Java; i.e, there's no way to explicitly declare one, and the idea isn't used much in Java (you can emulate one by giving your class only a private constructor and then never using it.) Frankly, it's just a mechanism for writing in a non-object-oriented style, and used only in fairly obscure cases like the java.lang.Math class, which holds a bunch of trignonometric and other free math functions. Classes like this lead to brittle, nonmodular code that's hard to test.
So my answer to your question is "no" -- there's never a good reason to do that. Put the state into instance methods, and make the methods instance methods, and that's that!