Java program to print ascii value of any char
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
String str = read.nextLine();
int ascii = (int) str.charAt(0);
System.out.println("ASCII value is : " + ascii);
}
}