991547 wrote:No, that's for converting a String back to an int. String.valueOf(int) can be used to convert an int into a String.
oh ok...changing int to string is with this method right? static int parseInt(String x)
I didn't understand the part u said: " (remember, '8' - '0' = 8) "...I actually don't really know anything about it, if u explain a little bit it would be great...The numerical value of the character '0' is 30 (or something). The numerical value of the character '1' is 31, and so on. So to convert a single digit char to an int you can do
char digit = '3'; int value = digit - '0'; // value is 3
in this case I need an int array, since I need to add or subtract the elements of the array to each other...(not sure if I can do that with a char array!or can I?)Well, it might be easier to do with an int array.
991547 wrote:Get it as a String in stead of an int (because this is not an int) and look at its length() in stead. Then convert to whatever datatype you need. Apparently you can't assume it will fit in an int or even a long, so you will need to use BigInteger as suggested.
and if the user inputs for example : 6612319192371381318298020093, how can I find out how many digit have that number?