how to convert char to int in java for android
for example:
int MyInt;
char MyChar = 'A';
how to insert the value 65 into MyInt ?
in C# it like: MyInt = Convert.ToChar(MyChar);
thanks
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.
You can do it the same way in both C# and Java:
I wouldn’t use
Convert.ToInt32(which is what I assume you meant) in C#… I’d just use the implicit conversion shown above.EDIT: In Java, this uses the implicit widening primitive conversion specified in section 5.1.2 of the Java Language Specification: