Skip to content

mkyong.com

  • Spring Boot
  • Java Virtual Threads
  • Contact
  1. Home /
  2. character

Tag: character

j
java December 1, 2009 3 min read by mkyong 4 comments

Java – Convert Character to ASCII

In Java, we can cast the char to int to get the ASCII value of the char. char aChar = ‘a’; //int ascii = (int) aChar; // explicitly cast, optional, improves readability int ascii = aChar; // implicit cast, auto cast char to int, System.out.println(ascii); // 97 The explicit cast (int)char is optional, if we […]

Read more Java – Convert Character to ASCII

Java and Spring tutorials since 2008. Every example is a complete, runnable file, compiled and run on a real machine before it goes out.

About This Site

  • About
  • Editorial Policy
  • Contact
  • Code License
  • Privacy Policy
  • Terms of Use

© 2026 mkyong.com — Powered by WordPress

RSS