Character.compare(char x, char y) has the following syntax.
public static int compare(char x, char y)
In the following code shows how to use Character.compare(char x, char y) method.
public class Main { public static void main(String[] args) { System.out.println( Character.compare('a', 'b') ); } }
The code above generates the following result.