Different outputs

exercise No. 211

Q:

We consider:

Code Output
char value = 10224;
System.out.println(value);

Hint: This is no printing error, the output actually shows up.

int value = 10224;
System.out.println(value);
10224

Why do we get two different outputs ⟰ and 10224 for the very same value? Describe the underlying mechanism.

A:

out is a static member in class System of type PrintStream. Within this class the println(...) method is multiply overloaded. Among these are: