Java examples for Language Basics:Primitive Types
Implicitly casts a character (of type char) into its corresponding ASCII integer code
public class Main { public static void main(String[] args) { char c='X'; int code=c; //from w w w.j a v a 2 s . com System.out.println(code); } }