0 if the string is lexicographically greater than the other string (or has more characters)
/**
* @author lautturi.com
* Java example: compare two strings in java
*/
import java.util.*;
public class Lautturi {
public static void main(String[] args) {
String myStr1 = "Hello";
String myStr2 = "Hello";
System.out.println(myStr1.compareTo(myStr2));
}
}
output:
0