Insert code units as integer literals:
#include <iostream>
int main() {
char[] string = { 0x41, 0x42, 0x43, 0x0A, 0x00 };
std::cout << string;
}
In Java this should do:
byte[] bytes = {(byte)0x41, (byte)0x42, (byte)0x43, (byte)0x0A};
String string = new String(bytes, "UTF-8");