hash code for string objects
<p>Hi  I am new to java programming,i want to create to multiple number of strings, for that written the code Below.why does it generating same hash code for both string objects.</p>

<pre><code>   class SingletonClass {
            public static String mystring="this"; 
        }
        public class SingletonObjectDemo {
            public static void main(String args[]) {
                String str = SingletonClass.mystring;
                String str2 = SingletonClass.mystring;
                System.out.println("String str  "+str.hashCode());
                System.out.println("String str1  "+str2.hashCode());
                    }
        }
</code></pre>
