what happens when converting char to string? (Java) <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java">How do I compare strings in Java?</a> </p> </blockquote> <p>I'm using String.valueOf to convert char to string. But the return value seems not exactly same as a string of the same letter. Codes below:</p> <pre><code> String myString = "s"; char myChar = 's';//both string and char are assigned as letter 's' String stringFromChar = String.valueOf(myChar); if (myString == stringFromChar) { out.println("equal"); } else { out.println("not equal"); } </code></pre> <p>Every time it prints not equal. Please help, thanks! :) </p>