- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.
Example
import java.util.Scanner; public class ASCIIValue { public static void main(String args[]){ System.out.println("Enter a character ::"); Scanner sc = new Scanner(System.in); char ch = sc.next().charAt(0); int asciiValue = ch; System.out.println("ASCII value of the given character is ::"+asciiValue); } }
Output
Enter a character :: e ASCII value of the given character is ::101
- Related Articles
- C++ Program to Find ASCII Value of a Character
- Java Program to Print the ASCII values
- Java Program to check whether the entered value is ASCII 7-bit control character
- How to Find ASCII Value of Character using Python?
- Java Program to check whether the character is ASCII 7 bit
- Haskell program to print ascii values
- Java Program to check whether the entered character is ASCII 7 bit numeric and character
- Java Program to check whether the character is ASCII 7 bit numeric
- Java Program to check whether the character is ASCII 7 bit printable
- C Program to print all ASCII values.
- Swift Program to Print the ASCII values
- Kotlin Program to Print the ASCII values
- Posix character classes p{ASCII} Java regex.
- C program to print the ASCII values in a string.
- Java Program to check if a particular value exists in TreeMap

Advertisements