Friday, July 21, 2017

How to convert String or char to ASCII values in Java

You can convert a character e.g. 'A' to its corresponding ASCII value 65 by just storing it into a numeric data type e.g. byte, int or long as shown below : int asciiOfA = (int) 'A'; Here casting is not necessary, simply assigning a character to integer is...

Pages (26)1234567 »