Hi!
I have the following code:
class StrBuf{
public static void main(
String args[]){
String s1 = "abcde";
StringBuffer s2 = new StringBuffer("abcde");
if(s1.equals(s2))
System.out.println("s1 equals s2!");
if(s2.equals(s1))
System.out.println("s2 equals s1");
}
}
This does not print out anything upon execution. I thought it would print out the "s1 equals s2"(from the 1st if stmt).
Can anyone explain the output?
Thanks
Sharda