Write a program in Java to find ASCII value of a Character.

ASCII : American Standard Code for Information Interchange

ASCII is encoding standard to represent characters in computers. By using a 7-bit binary number, a character is defined. There are 128 possible characters.

Code:

//ASCII_Value 
public class ASCII_Value {
	public static void main(String[] args) {
		// Enter any character like a-z,A-Z to see there ascii Value.
		char character = 'a';
		// Basically character typecast into int type and it given the ascii code of
		// character.
		int ascii = (int) character;
		System.out.println(character + " ASCII Value is : " + ascii);

	}

}

Output:
ASCII_Value

(Visited 87 times, 1 visits today)
Share with Friends :
Written by: