1/*ASCII acronym for American Standard Code for Information Interchange.
2It is a 7-bit character set contains 128 (0 to 127) characters.
3It represents the numerical value of a character.
4For example, the ASCII value of A is 65.*/
5char a = 65, b = 66, c = 67;
6System.out.println(a);
7System.out.println(b);
8System.out.println(c);
9
10/* this is how you type ASCII values in java */
1public class AsciiValue {
2
3 public static void main(String[] args) {
4
5 char ch = 'a';
6 int ascii = ch;
7 // You can also cast char to int
8 int castAscii = (int) ch;
9
10 System.out.println("The ASCII value of " + ch + " is: " + ascii);
11 System.out.println("The ASCII value of " + ch + " is: " + castAscii);
12 }
13}
1public class AsciiValue {
2
3 public static void main(String[] args) {
4
5 char ch = 'a';
6 int ascii = ch;
7 // You can also cast char to int
8 int castAscii = (int) ch;
9
10 System.out.println("The ASCII value of " + ch + " is: " + ascii);
11 System.out.println("The ASCII value of " + ch + " is: " + castAscii);
12 }
13}
14