Java program to print ASCII value of a particular character

ASCII stands for American Standard Code for Information Interchange. There are 128 standard ASCII codes, each of which can be represented by a 7-digit binary number: 0000000 through 1111111.

If you try to store a character into an integer value it stores the ASCII value of the respective character.


import java.util.Scanner;
public class ASCIIValue {
   public static void main(String args[]){
      System.out.println("Enter a character ::");
      Scanner sc = new Scanner(;
      char ch =;
      int asciiValue = ch;
      System.out.println("ASCII value of the given character is ::"+asciiValue);


Enter a character ::
ASCII value of the given character is ::101
Lakshmi Srinivas
Lakshmi Srinivas

Programmer / Analyst / Technician