Java String contentEquals example

String’s contentEquals method is used to compare String with StringBuffer. It returns boolean datatype.

Method syntax:

String contentEquals Example:

When you run above program, you will get below output:

Please note that contentEquals method is case sensitive as you can see in above example

Add Comment