// chars // see p546-547 LL class Test { char c; } public class chars0 { public static void main(String[] args) { char x = '0'; Test t = new Test(); System.out.println(x); System.out.println( (int) x ); System.out.println( (char) 48 ); System.out.println( x + 1 ); System.out.println(t.c); // 'A' = 65, 'a' = 97 --> 'A'-'a'=-32 // 'C' = 67, 'c' = 99 --> 'c'-32 =99 System.out.println( (char)('c'+'A'-'a') ); // convert to uppercase System.out.println( (char)('d'+'A'-'a') ); // convert to uppercase } } /* Output: 0 48 0 49 <-- ASCII NULL character (but not Java $null$) C (uppercase C) D (uppercase D) */