I was trying Math m = new Math(); and later found that Math constructor is private and it does not have any other constructors as well. I understand that all the methods in Math are static but i was just trying my
SCJP knowledge.
Here is the code of class Math taken from Sun
Java 1.5
In real world if requirement is to write a Utility class that has only static methods then is the above behavior of making the constructor private done just to avoid instantiation of the class inorder to save memory? Or is there any other significance behind this?
Thanks
Deepak