Total sum of Integer in Java
<p>Hi i have a exercises in Java. Given that i have an Integer that Value is 367; Now this is the problem how would it print as "16"; how can i compute the value as like (3+6+7);Here's my code.</p>

<pre><code>int val = 367;

for(int  i = 0; i &lt; val;i++){
    (What Method Will i use on this?)
}
</code></pre>
