Can anybody explain why the equals() method in StringBuffer is not overriden? Assuming in main() block: StringBuffer s1=new StringBuffer("hello"); StringBuffer s2=new StringBuffer("hello"); System.out.println(s1.equals(s2)); The code returns false. I could not understand it? Help please.
Hi Jordan, I've never come across any reason why <code>equals()</code> isn't overridden in <code>StringBuffer</code>; just that it isn't. Not much help, I know ... you just need to remember that <code>String</code> and the Wrapper classes overload <code>equals()</code> and that <code>StringBuffer</code> doesn't.
------------------ Jane Griscti Sun Certified Programmer for the Java� 2 Platform