public class SupplementaryCharTest3 { public static void main(String[] args) { char[] ch = new char[]{(char)0xD801, (char)0xDC00}; int codePoint = Character.toCodePoint(ch[0], ch[1]); System.out.format("UTF-16 %X %X -> %X\n", (int)ch[0], (int)ch[1], codePoint); String str1 = new String(new int[]{codePoint}, 0, 1); String str2 = new String(ch); System.out.format("U+0010400 == UTF-16 D801 DC00 : %b%n", str1.equals(str2)); } }