Java Character.compare(char x, char y)
Syntax
Character.compare(char x, char y) has the following syntax.
public static int compare(char x, char y)
Example
In the following code shows how to use Character.compare(char x, char y) method.
public class Main {
//from ww w . j a va 2 s. c o m
public static void main(String[] args) {
System.out.println( Character.compare('a', 'b') );
}
}
The code above generates the following result.