title: compareTo() function in Java
body: <p>I have written the code below</p>
  
  <pre><code>import java.util.*;
  class compare{
      public static void main(String []args){
          String s1="java";
          String s2="javaProgramming";
          System.out.println(s1.compareTo(s2));
      }
  }
  </code></pre>
  
  <p>The output for this code is -11. Since there is no character for termination of string in java, which character in "java" is being compared with 'P' in "javaProgramming"? </p>