For example we have a number 1709. How to define every digit of the number. Should we cast type to string. Then to parse it with toCharArray method. And use the indexes to have an access to char array of this particular digit also with reversal type casting. For example: int number=1709; char [] array=number.toCharArray(); int b=9; int suma=b+(int)array[0]; System.out.print(suma); is it correct at least in principle or we should use other way?