Java String equals example

String’s equals method compares String with specified object. It checks if both have same character sequence. It is generally used to compare two Strings.

Method Signature:

String equals Example:

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

Was this post helpful?

Leave a Reply

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