|
From what i learn so far, in Java, String is an object, not a primitive type
The default way to create an object is by using the new keyword, like in the 2nd statement u wrote
But as to the impractical way of using a new keyword each time u create a String -which the designer assume are going to be often that is, and it certainly does- the language designer deiced to put a shortcut to instantiate a String without using the new keyword, and also to make it look similar like how u would initialize a String in other programming language
|