Opening Hours :7AM to 9PM
class Main { public static void main(String args[]) { char ch = 'A'; int asciiValue = (int) ch; System.out.println(asciiValue); // prints "65" } }You can also use the int value of the character directly, without using the cast operator:
class Main { public static void main(String args[]) { char ch = 'A'; System.out.println((int) ch); // prints "65" } }Note that ASCII values are integers that represent specific characters in the ASCII table. The ASCII value of 'A' is 65, the ASCII value of 'B' is 66, and so on.