In this example,we will learn the method to convert character to ASCII in Java.
Source Code
package com.beginner.examples;
public class Char2ASCII {
public static void main(String[] args) {
char a = 'a';
System.out.println((int)a); // convert character to ASCII
}
}
Output:
97