Online Java Compiler By
JavaTpoint.com
public class JavaCharactergetNumericExample3 { public static void main(String[] args) { // Initialize a codepoint int codepoint1 = 110; int codepoint2 = 00; int codepoint3 = 54; // Convert codepoint to char char ch1 = (char) codepoint1; char ch2 = (char) codepoint2; char ch3 = (char) codepoint3; // Convert the code point to its numeric value int digit1 = Character.getNumericValue(codepoint1); int digit2 = Character.getNumericValue(codepoint2); int digit3 = Character.getNumericValue(codepoint3); // Print the result System.err.println("The character '" + ch1 + "' has a numeric value represented as: " + digit1); System.err.println("The character '" + ch2 + "' has a numeric value represented as: " + digit2); System.err.println("The character '" + ch3 + "' has a numeric value represented as: " + digit3); } }
Output