Having just static methods in a class does not qualify it being a Singleton
, as you can still make as many instances of that class, if you have a public constructor
in it.
For a class to qualify as Singleton
, it should have private constructor
, so that it can't be instantiated from outside the class, and have a static factory
that returns the same instance
everytime invoked.
If you really mean static class
, then first of all, you can't have your top-level
class as static
. You can only have static nested class
, in which case you don't need to create any instance of that class, but you can and you can create multiple instances and hence it as not Singleton
.
Also, the class you mentioned - java.lang.Math
, is not a static class. You should see the documentation of that.