Implicitly casts a character (of type char) into its corresponding ASCII integer code - Java Language Basics

Java examples for Language Basics:Primitive Types

Description

Implicitly casts a character (of type char) into its corresponding ASCII integer code

Demo 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); 
  }
}

Result


Related Tutorials