just when i thought i knew it all:
String str="String";
if("String".toString() == str.toString())
System.out.println("Equal");
else
System.out.println("Not Equal");
prints equal......why???
if("String".replace('g','G') == "String".replace('g','G'))
System.out.println("Equal");
else
System.out.println("Not Equal");
prints not equal.....why?
if("String".replace('t','t') == "String".replace('t','t'))
System.out.println("Equal");
else
System.out.println("Not Equal");
prints equal.....why?
thanks in advance