Program to find ASCII value of character

Java program to find ASCII value of character

public class AsciiValue {

    public static void main(String[] args) {

        char ch = 'a';
        int ascii = ch;
        
        int castAscii = (int) ch;

        System.out.println("The ASCII value of " + ch + " is: " + ascii);
        System.out.println("The ASCII value of " + ch + " is: " + castAscii);
    }

}

Comments

Popular posts from this blog

Java Variables and Datatype

JAVA Features

Java Fundamentals