How to convert the Unicode of a number to the number itself in Java?
char c ='2';
int x =c;
// here x=unicode of 2, how can I put the 2 itself in x?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
or
Note that the second approach requires two conversions since Integer.valueOf can only handle other ints and Strings.