strings

what is the difference between the following code?String s="abc";andString s=new String("abc");
[123 byte] By [java@srinua] at [2007-11-26 15:49:29]
# 1
This question keeps on surfacing all the time. If only the forums (and generally the Web) were searchable!A hint: cf. constant pool.
BIJ001a at 2007-7-8 22:09:08 > top of Java-index,Java Essentials,New To Java...
# 2
String a = "abc";String b = "abc";String c = new String("abc");System.out.println(a == b);System.out.println(b == c);
CaptainMorgan08a at 2007-7-8 22:09:08 > top of Java-index,Java Essentials,New To Java...