String Compareto vs es igual a Java

compareTo() when you need to know the difference in length between strings 
that start with the same sequence of characters.
  
  System.out.println("sumit".compareTo("timus"));//-1
coder