Why the designers decided not to let you make an instance ... They put all the functionality you need in static methods and variables so no instance is necessary.
Why you can't make one against their wishes ... They made the constructor private. This is a common way to build classes that are meant to be all static or that want to control instantiation, for example the Singleton pattern.
You can download the source for the library and look up things like this:
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
The reason why System class is not instantiated is ,System class has a private constructor().
System class has no constructor that's why it can not be instantiated not even a private constructor. As we see in string api,there is no constructor defined. Please let me know if its the correct reason.
isha krishnan wrote:System class has no constructor that's why it can not be instantiated not even a private constructor.
That is not correct. The System class does have a private constructor, which is not mentioned in the Javadoc documentation. The private constructor is what prevents you from instantiating the class. If a class has no constructor, a public constructor which does not take arguments is automatically added by the Java compiler. So if a class has no constructor, it can still be instantiated.
You can lookup the source code for class System in the file src.zip which is in your JDK installation directory. There you'll see that it has a private constructor, as Stan James already showed above.
isha krishnan wrote:As we see in string api,there is no constructor defined.
It is normal for private members and constructors not to appear in the API documentation. The javadoc tool usually does not produce visible output for private members. Anybody reading about uninstantiable classes would think of this (or similar).