char
| Code | Result |
|---|---|
char c; c = '↔'; // Left-right arrow character c = '\u2194'; // Same, in Unicode hexadecimal representation // 8596 = 16 * (16 * (2 * 16 + 1) + 9) + 4 c = 8596; // Same, int decimal literal to char narrowing IO.println(c); IO.println((int) c); |
↔
8596 |
No. 28
Show neighboring characters
|
Q: |
Print the next 6 Unicode characters following '↔' similar to Figure 101, “char ” by using Unicode hexadecimal encoding. Repeat the same exercise using regular decimal encoding. Hint: You have to turn int values into char ones. In Figure 101, “char ” it was done the other way round. |
||||||
|
A: |
The ratio behind the above code: E.g. the
|
