seetharaman venkatasamy wrote:.. two reference for the objects are placed in the string constant pool.
No. SCP contains references to unique String literals. So whenever your program make a reference to that String object it is replaced with the reference to the object referenced from SCP. Check StringLiterals.
Can you point out the bit in this article that says instances of objects are created a compile time? How are any instances of an object created at a point in the procedings where there is no JVM involved, and hence no heap to store these on?
shaiksha vali wrote:What is mean by String Mutable and Immutable
I don't get that statement . Strings are immutable
Now this is a bit off topic. Mutable means that you can change the data contained in the object once created. For String once you create an object of String you cannot change the value it holds (i.e: Immutable).
You can reference methods of an object based on the variable type. For example, if you store a String in a String variable, you can run String methods on it. If you store the String in a variable of type Object, then you can only run Object methods.