how can i test the equality of two different StringBuffers (s1, s2)?? Although s1.equals(s2) compiles fine, but it doesn't show the equality. should i write a complete code to do that? isn't there any method i can use? by the way should i know all the methods that are used to manipulate Strings and StringBuffer for the SCJP 1.4 exam?
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
StringBuffer class doesn't override equals() method, so you can't expect it to perform lexicographical comparison of the String contents as String would do. It helps to learn the most frequently used methods of String and StringBuffer and their behaviour for the exam.