/** * Name: Erica Eddy * Course: CSCI 241 - Computer Science I * Section: 001 or 002 * Example: Converting ASCII to char and * char to ASCII */ public class CharASCII { public static void main (String [] args) { System.out.println ("ASCII code of character X = " + (int) 'X'); System.out.println ("Character with ASCII code 88 is " + (char) 88); System.out.println ("G + 3 = " + (char)('G' + 3.2)); System.out.println ("A * 2 - 25 = " + (char)('A' * 2 - 25)); System.out.println ("ASCII value of 'A' = " + (int)'A'); System.out.println ("ASCII value of 'a' = " + (int)'a'); char fiveChar = '5'; System.out.println ("ASCII value of char 5 = " + (int) fiveChar); } }