6,100 results
Open links in new tab
  1. Java String compareTo () Method - W3Schools

    Definition and Usage The compareTo () method compares two strings lexicographically. The comparison is based on the Unicode …

  2. Java String compareTo() Method with Examples - GeeksforGeeks

    Jan 20, 2025 · The String class of Java comprises a lot of methods to execute various operations on strings and we will be focusing …

  3. Comparable (Java Platform SE 8 ) - Oracle

    Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less …

  4. Java - String compareTo () Method - Online Tutorials Library

    The Java String compareTo() method is used to compare two strings lexicographically. It returns an integer value, and the …

  5. Java - String compareTo () Method - Online Tutorials Library

    Syntax Here is the syntax of this method − int compareTo(Object o) Parameters Here is the detail of parameters − O − the Object to …

  6. Java | ==, equals (), compareTo (), equalsIgnoreCase () and compare ()

    Jan 22, 2026 · In Java, there are multiple ways to compare two String objects. Each method serves a different purpose and behaves …

  7. Guide to Implementing the compareTo Method - Baeldung

    May 29, 2025 · Learn about how to implement the compareTo method using core Java.

  8. String (Java Platform SE 8 ) - Oracle Help Center

    In this case, compareTo returns the difference of the two character values at position k in the two string -- that is, the value: ... If there …

  9. Java String compareTo () - Programiz

    In this tutorial, we will learn about the Java String compareTo() method with the help of examples.

  10. Java String compareTo Method With Programming Examples

    Apr 1, 2025 · In this tutorial, we will learn about the Java String compareTo() method and see how and when to use compareTo in …