Get the numeric value for a char
static int getNumericValue(char ch)
- Returns the int value that the specified Unicode character represents.
public class Main {
public static void main(String[] argv) {
Character character1 = new Character('a');
Character character2 = new Character('b');
System.out.println(character1.toString());
System.out.println(Character.getNumericValue(character2));
}
}
The output:
a
11