I have a Java fragment that looks like this:
char ch = 'A';
System.out.println("ch = " + ch);
which prints: A
then when I do this
ch++; // increment ch
System.out.println("ch =" + ch);
it now prints: B
I also tried it with Z and resulted to a [ (open square brace)
and with - and resulted to .
How did this happen? What can be the possible explanation for this? Thanks in advance.
For characters 0 to 127, you follow the ASCII character set.
As you can see the character after (90)
Zis (91)[and the character after (45)-is (46).Try
or even more bizarre