You can't do it with a single char
(which holds a UTF-16 code unit), but you can use a String
:
// This represents U+10FFFF
String x = "udbffudfff";
Alternatively:
String y = new StringBuilder().appendCodePoint(0x10ffff).toString();
That is a surrogate pair (two UTF-16 code units which combine to form a single Unicode code point beyond the Basic Multilingual Plane). Of course, you need whatever's going to display your data to cope with it too...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…