How to get the char code in Java

To get the char code in Java you can use the following snippet.

Sample Java

System.out.println((int)'C'); // prints 67

Please Share us:
Please rate this snippet

One thought on “How to get the char code in Java

Leave a Reply