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.
Class String has several constructors.