Skip to content

mkyong.com

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

Tag: ascii

java January 20, 2010 3 min read by mkyong 18 comments

How to convert String to Hex in Java

Here are a few Java examples of converting between String or ASCII to and from Hexadecimal. Apache Commons Codec – Hex Integer Bitwise 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F 1. Apache Commons Codec Both Hex.encodeHex and Hex.decodeHex can convert String to Hex and vice versa. […]

Read more How to convert String to Hex in Java
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