Hello!
By details of this kata we must sum up the CUBES of digits.
I think you need to fix it here "sum += Character.getNumericValue(num);"
However, it is great solution
It only works when the variables are the same type. e.g. here i and j are both int.
I did not know about that ...
Hint: It pays to re-visit the language spec sometimes. There are lots of little things that are useful but maybe you don't see them much in common use. Do it now. You will quickly learn something else you didn't know about...
Thanks for teaching me something new :)
Hello!
By details of this kata we must sum up the CUBES of digits.
I think you need to fix it here "sum += Character.getNumericValue(num);"
However, it is great solution
It only works when the variables are the same type. e.g. here
i
andj
are bothint
.Hint: It pays to re-visit the language spec sometimes. There are lots of little things that are useful but maybe you don't see them much in common use. Do it now. You will quickly learn something else you didn't know about...
I did not know about that you could use two different variables in the for loop like that. You will have a better coding career than me. Props
Not sure what you mean... It's just common syntax
https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.14.1
How did you learn to code the for loop like that?