What is the advantage of declaring String s= new String("abc").intern(); over String s="abc"(or vice versa)
<p>As I understand that<br>
1) String s="abc"; creates "abc"  in string pool and<br>
2) String s=new String("abc").intern(); string pool reference is returned irrespective of whether "abc"  exists in pool before or not. </p>

<p>My question is </p>

<p>What is the advantage of 1) over 2) (or vice versa) since both of these returns the reference from pool. 
Which syntax is preferred? </p>

<p>In 2) irrespective of "abc"  present in pool, will the object gets created in heap initially and then its lost? (eligible for gc) </p>