Tag: compare string and stringbuilder

contentEquals() String Example

November 9, 2014 · 1 min read
###### We know earlier equals() method is used to compare two strings whether they have same sequence of characters or not. But this method cannot compare **String** with **StringBuffer**. Even if they have same characters, the **equals()** returns **false**. In this case use contentEquals() String.