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:

Add Comment