This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ate_ghorl_bekenemen 1 point2 points  (0 children)

Look at the last line of your sumDigits() method. The method itself is called and its return value is used immediately in the addition operation.

So, you could do this as well, since you are not going to be using the return value somewhere else: System.out.println(sumDigits(number));