string pool in java
when we declare a string object in the form of String aa=new String("java") and String aa="java" ,then is that in both cases the string object is made on the heap area.
Or is it the case that in first case we have a string pool wherein we have a string literal whose value is "java" and the reference of that string literal in the string pool is returned to the object in the heap created by the expression new String("java") ,and now the reference of this object is actually returned to the reference variable a.
And in the second case we have the reference variable a directly pointing directly to the string literal "java" which is present in string pool.