Just started to learn Java. Please explain.
String firstString = new String("This is first string"); String secondString = firstString; As far as I know, in the second case in the secondString variable there should be a reference to the firstString object . But a copy of the object is created. The situation with other objects is quite different. Why? After all, is the String an object too?