Answers for "how to convert a character from char to int"

4

char to int

char a = 'a';
int ia = (int)a; 
/* note that the int cast is not necessary -- int ia = a would suffice */
Posted by: Guest on March-31-2022

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language