// UseASCII: show that you can manipulate ASCII codes import java.io.*; class UseASCII { public static void PrintBits(char x) { int i; for (i = 7; i >= 0; i--) if ( (x & (1 << i)) != 0 ) System.out.print("1"); else System.out.print("0"); } public static void main(String[] arg) throws IOException { BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in)); char oldChar, newChar; int i; System.out.print ("Enter a character: "); oldChar = (char) stdin.read(); System.out.println (); System.out.println ("Input char is: " + oldChar); System.out.println (" its integer value = " + (int) oldChar ); System.out.println (); newChar = (char) ( (int) oldChar + 1 ); System.out.println ("New char is: " + newChar); System.out.println (" its integer value = " + (int) newChar ); System.out.println (); } }