**in the first**. This is not the same as calculating the sum of the even Fibonacci numbers

*N*Fibonacci numbers**smaller than**.

*N*The 400,000

^{th}Fibonacci number is approximately 10

^{83,590}. This is larger than any built-in type in Java (or any other language I'm aware of).

Check the condition of your loop; it should be something like:

Java

while (b < n) // don't sum Fibonacci numbers larger than n { … }