You are on page 1of 2

How to Print ASCII Value in Java | ASCII Value

Write a Program to Print ASCII Value in Java. How to Print ASCII Value in Java. The user
has to enter the Character and the program should print the ASCII Value in Java Language.
How to convert characters to ASCII Values in Java. ASCII was developed from telegraph
code. Its first commercial use was as a seven-bit teleprinter code promoted by Bell data
services.

Work on the ASCII standard began on October 6, 1960, with the first meeting of the
American Standards Association's (ASA) (now the American National Standards Institute or
ANSI) X 3.2 subcommittee. The first edition of the standard was published in 1963. Full
Form of ASCII Is ( American Standard Code for Information Interchange). Print ASCII
Value in Java.

ASCII Code Table – Printable, Non-Printable & Extended PDF.

Note: The class name should be the same as the program name

See Also C++ Program To Print ASCII Value Of Character

How to Print ASCII Value in Java


import java.util.Scanner;

/*How to Print ASCII Value in Java*/

class ascii //class name


{

public static void main(String args[]) {

System.out.print("Enter Any Character to Print


ASCII Value in Java: ");
Scanner sc = new Scanner(System.in);
char ch = sc.next().charAt(0);

int ascii = ch;

System.out.println("ASCII Value is: " + ascii);


}
}
See Also C Program To Print ASCII Value Of Character

Print ASCII Value in Java Output

You might also like