Java tutorial
public class Main { public static void main(String[] args) { Character c1 = new Character('a'); Character c2 = new Character('b'); int result = c1.compareTo(c2); String str1 = "Equal "; String str2 = "First character is numerically greater"; String str3 = "Second character is numerically greater"; if (result == 0) { System.out.println(str1); } else if (result > 0) { System.out.println(str2); } else if (result < 0) { System.out.println(str3); } } }