From the documentation:
char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).
Source
They are just 16-bit unsigned integers.
People have reported that if char > 65535
, the result was char % 65536
, so I suppose your char c
will be -98 % 65536
, which would result in 65536 - 98 = 65438
.
Anyway to be 100% sure, why don't you just try it?
UPDATE:
I see that you want to know what the output of System.out.println(char)
(for example) is.
Literals of types char and String may contain any Unicode (UTF-16) characters
Source
So System.out.println((char)65438)
is then equivalent to System.out.println('\uFF9E')
, which by doing a lookup on the UTF-16 encoding table (source) is a HALFWIDTH KATAKANA VOICED SOUND MARK
. It will only be printed though if the font supports this character, one of such fonts is Arial Unicode MS
.