string compareto vs sama dengan 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