I don't know what the output means? Will anyone help me with this? Please explain me how it works.
public class LastIndexOfExample{
public static void main(String args[]){
String s1="hello";
String s2="hello";
String s3="meklo";
String s4="hemlo";
System.out.println(s1.compareTo(s2));
System.out.println(s1.compareTo(s3));
System.out.println(s1.compareTo(s4));
}
}
Then the output is: 0 -5 -1
From
compareTo
javadoc:Full Javadoc:
And from the online documentation (link above):