We are going to share Java Program to find ASCII value of a character with the output. If you are a Java beginner and want to start learning the Java programming, then keep your close attention in this tutorial as I am going to share how to write a Java program to find ASCII value of a character.
Java program to find ASCII value of a character with the output
Copy the below Java program and execute it with the help of Javac compiler. At the end of this program, We have shared the output of this program.
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); } }
Program Output
The ASCII value of d is: 100
The ASCII value of d is: 100
Liked this program? Do Like & share with your friends.
The post Java program to find ASCII value of a character appeared first on FreeWebMentor.
This post first appeared on Programming Blog Focused On Web Technologies, please read the originial post: here