String: compareTo() (Java)


Video is ready, Click Here to View ×

This video looks at how the compareTo() method is used within the String class of Java. It explains lexicographic ordering and special cases in Java.

27 thoughts on “String: compareTo() (Java)

  1. Hey Nathan:

    Great lesson. Explained it perfectly. Now, if I gotta write a program to sort a String array alphabetically (not bothering about length, of course), would the compareTo method suffice?


  2. Thank you soooooooooooooooooo much. How you explain from 0 to 10 it's 100. You should be teaching at Yale or Harvard. You're my new teacher from now on. I subscribed you and following you.

Leave a Reply

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