Get the numeric value for a char

ReturnMethodSummary
static intgetNumericValue(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
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.