char to integer in Java

//char to integer
// character to ascii value
 class Demoascii
{
public static void main(String args[])
{

char ch = 'A';
System.out.println("ascii value for A is"+ (int)ch);
}
}


Output:
ascii value for A is65