Java String equals example

Previous
Next

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:

Previous
Next

Add Comment