What is difference between equal and contentEquals?

equals() and contentEquals() are two methods in String class to compare two strings and string with StringBuffer . The parameters of contentEquals() are StringBuffer and String(charSequence) . equals() is used to compare two strings and contentEquals() is used to compare the contents of String and StringBuffer .

Sizin İçin Seçtik  What is difference between and == in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *