Java String endsWith example

String’s endWith method checks if String ends with specific suffix. It returns boolean datatype.

Method syntax:

String endsWith Example:

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

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

Add Comment