Java sum of multiples in for loop
<p>I wrote the following code to get all of the numbers from 0 to 1000 that are multiples of three:</p>

<pre><code>public class Hi {
  public static void main(String[] args) {
    for(int i = 0; i&lt;1000; i++)
        if(i % 3 == 0)
          System.out.println(i);
  }
}
</code></pre>

<p>Now I would like to add these numbers together and print the result after the loop.</p>