What does compareTo method do in Java?

The compareTo() method compares two strings lexicographically . The comparison is based on the Unicode value of each character in the strings. The method returns 0 if the string is equal to the other string.

Sizin İçin Seçtik  What is an example of a tech stack?

Leave a Reply

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

What does compareTo method do in Java?

The compareTo() method compares two strings lexicographically . The comparison is based on the Unicode value of each character in the strings. The method returns 0 if the string is equal to the other string.

Sizin İçin Seçtik  Is compareTo case sensitive?

Leave a Reply

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