Java Data Type Tutorial - Java Character .getNumericValue(char ch)








Syntax

Character.getNumericValue(char ch) has the following syntax.

public static int getNumericValue(char ch)

Example

In the following code shows how to use Character.getNumericValue(char ch) method.

public class Main {
  public static void main(String[] argv) {
    Character character1 = new Character('a');
    Character character2 = new Character('a');
    System.out.println(character1.toString());

    System.out.println(Character.getNumericValue(character2));
  }
}

The code above generates the following result.