Convert from integer to ASCII code (byte) in Java
Description
The following code shows how to convert from integer to ASCII code (byte).
Example
/*from w w w .j av a 2 s .c o m*/
public class Main {
public static void main(String[] args) throws Exception {
char c = 'A';
int i = (int) c; // i == 65 DECIMAL
}
}
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »