The full form of ASCII is American Standard code for information interchange. Each letter of keyboard can be represented through a certain ASCII code. The aim of this project is to display the ASCII code of the given letter. As we have not discussed the user input till this time so we will not use that. Directly we will assign a character to a char type variable and find out its ASCII code and display it on screen.

If you want to learn Java from Beginning please Click Here.

// Project to find ascii value of any character
public class Project1{

public static void main(String[] args) {

char x = ‘A’;
int y = x;

System.out.println(“ASCII value of “+ x +” is: ” + y);

}
}