// Casting to the Unicode value of a specific character. // Must be done character by character. // The Unicode values can be added, subtracted etc etc public class CastToUnicode { public static void main(String[]args) { String serialNumber = "ZA8-4579-PQ"; char myChar1 = serialNumber.charAt(0); int intChar1 = (int)myChar1; char myChar2 = serialNumber.charAt(1); int intChar2 = (int)myChar2; char myChar3 = serialNumber.charAt(2); int intChar3 = (int)myChar3; int total = intChar1 + intChar2 + intChar3; System.out.println("Character one is : " + myChar1 + " and has a Unicode value of " + intChar1); System.out.println("Character two is : " + myChar2 + " and has a Unicode value of " + intChar2); System.out.println("Character three is : " + myChar3 + " and has a Unicode value of " + intChar3); System.out.println("Total Unicodes = " + total); } }