Online Java Compiler By
JavaTpoint.com
public class JavaCharactertoCodePointExample2 { public static void main(String[] args) { // Create four char objects. char high1 = '\ud900'; char low1 = '\ud120'; char high2 = '\ud560'; char low2 = '\ud320'; // Converts the specified surrogate pair into its respective supplementary codePoint int result1 = Character.toCodePoint(high1, low1); int result2 = Character.toCodePoint(high2, low2); // Print the result. String str1 = "The result for the above character is given as:"+result1; String str2 = "The result for the above character is given as:"+result2; System.out.println(str1); System.out.println(str2); } }
Output