comapring two strings

hey,

in this code:

String str= "java";

String s= "java";

String tmp= new String("java");

t= s.equals(tmp);

System.out.println(t);

=(s==tmp);

System.out.println(t);

t= (str==s);

System.out.println(t);

why would the second print, print false?

whats the difference between: new string("java") and: ="java"

[383 byte] By [lital_aa] at [2007-11-27 2:12:30]
# 1
search the forum, this question has been asked a zillion times
thomas.behra at 2007-7-12 2:06:53 > top of Java-index,Java Essentials,Java Programming...
# 2
Now it's been asked a zillion and one ;-(
DrLaszloJamfa at 2007-7-12 2:06:53 > top of Java-index,Java Essentials,Java Programming...
# 3
Forum search yields e.g.: http://java.sun.com/developer/JDCTechTips/2004/tt0504.html#2
thomas.behra at 2007-7-12 2:06:53 > top of Java-index,Java Essentials,Java Programming...
# 4
sorry for asking but i couldnt find a specific result on the difference between using the new command and without it.thanks :) that really helped me!!!
lital_aa at 2007-7-12 2:06:53 > top of Java-index,Java Essentials,Java Programming...