title: Project Euler #10 Java not working
body: <p>The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.</p>
  
  <p>Find the sum of all the primes below two million.</p>
  
  <pre><code>            public class Problem10
              {
                  public static void main(String[] args)
                  {
                      int sum = 17;
                      for(long i=11; i&lt;2000000; i+=2)
                      {
                          if(isPrime(i)) sum += i;
                      }
                      System.out.println(sum);    
  
                  }
  
                  public static boolean isPrime(long n)
                  {
                      if(n==2) return true;
                      if(n%2 == 0) return false;
                      for(long i=3; i&lt;= Math.sqrt(n); i+=2)
                      {
                          if(n%i == 0) return false;
                      }
                      return true;
                  }
              }
  </code></pre>
  
  <p>I don't see what is wrong with this. It keeps printing 1179908154 which is incorrect.</p>