Just want to make sure whether the StringBuffer class overrides the equals() method of the Object class. I say no. It doesn't override it. So, StringBuffer sb1 = new StringBuffer("Amit"); StringBuffer sb2= new StringBuffer("Amit"); sb1.equals(sb2) returns false.
StringBuffer class doesnot override equals(). That is when we use equals() for StringBuffers, what is done is just reference comparasion - the behaviour inherited from Object class. Boolean and String classes override equals() method. Thus when two strings are compared - comparison is done for equality of string contents not thier handles. Shrinivas
Sun Certified programmer for Java2 platform.<BR>Shri_mk@hotmail.com