Regarding the role of intern() method
<p>I have made the code but please tell the functionality of the <code>intern()</code> method of String class , does it try to bring the pool object address and memory address on the same page?</p>

<p>I have developed the below code :</p>

<pre><code>    public class MyClass
    {   
         static String s1 = "I am unique!";
         public static void main(String args[])
         {
            String s2 = "I am unique!";
            String s3 = new String(s1).intern();// if intern method
 is removed then there will be difference
          // String s3= new String("I am unique!").intern(); 

            System.out.println("s1 hashcode --&gt;"+s1.hashCode());
            System.out.println("s3 hashcode --&gt;"+s3.hashCode());
            System.out.println("s2 hashcode --&gt;"+s2.hashCode());
            System.out.println(s1 == s2);
            System.out.println("s1.equals(s2) --&gt;"+s1.equals(s2));
            /* System.out.println("s1.equals(s3) --&gt;"+s1.equals(s3));
             System.out.println(s1 == s3);
            System.out.println(s3 == s1);
            System.out.println("s3--&gt;"+s3.hashCode());*/
        //  System.out.println(s3.equals(s1));
        }
    }
</code></pre>

<p>Now what's the role of the above <code>intern()</code> method? </p>

<p>As the <code>hashCodes()</code> are the sames, please explain the role of <code>intern()</code> method.</p>

<p>Thanks in advance.</p>
