Check out example codes for "java get an int from a char". It will help you in understanding the concepts better.

Code Example 1

char charValue = '2';
int intValue = Character.getNumericValue(charValue); // 2

Learn ReactJs, React Native from akashmittal.com