hi guys,
code:
int a = 0;
StringBuffer s = new StringBuffer("Hello");
if ((s.length() < 10) | (s.append(" world").equals("Well done")))
; // do nothing
System.out.println("Value is - " + s);
in the above code, i thought the result is "Hello",b'cas
string buffer doesn't override the equals method, so the result is same as s. but the ans is helloworld, how?
anybody correct me?
thx in advance