The value returned from compareTo method will depend upon the Strings compared.For example :
class Test{
public static void main(String args[]){
System.out.println(args[0].compareTo(args[1]));}}
Different cases for the different value at the command line arguement
case 1 : "abc" , "abcdef"
The returned value will be the difference of the length of abc and that of abcdef. Output 3-6=-3
Because in this case "abc" is a substring of "abcdef"
case 2 : "abcdef " , "ab"
Output 6-2=4
case 3 : "abhdef" , abdef
Here in this case noone is substring of another.Hence the check is done whether the first 2 letters of the both the strings differ and like wise it goes on till the first ocurring dissimilsrity.In the above case the the 3rd letter of both the strings differ.
Output : The place of h - the place of d =4
case 4 : "abcdef","ad"
Output : b-d=-2
I hope u r clear...