Ascii To Char Java Code Example
Example 1: how to convert an ascii number to character in java // From Char to Ascii char character = 'a'; int ascii = (int) character; // From Ascii to Char int ascii = 65; char character = (char) ascii; Example 2: number to char java char b = Integer.toString(a);//7-->"7" char b = (char) b;//65-->"A" Example 3: how to get a character in java in ascii import java.text.ParseException; import java.util.Arrays; /** * How to convert a String to ASCII bytes in Java * * @author WINDOWS 8 */ public class StringToASCII { public static void main(String args[]) throws ParseException { // converting character to ASCII value in Java char A = 'A'; int ascii = A; System.out.println("ASCII value of 'A' is : " + ascii); // you can explicitly cast also char a = 'a'; int value = (int) a; System.out.println("ASCII value of ...