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

Sample Java

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

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

Leave a Reply