find the sum of even number not exceed four million
<pre><code>class fibo {

    //int firstNumber = 0;

    public static void main(String args[]){
        //int firstNumber = 0;
        int length = 4000000;
        int[] series = new int[length]; 
        //long[] sum = new long[4000000];
        long sum =0;
        series[0] = 0;
        series[1] = 1;
        for (int i = 2; i&lt;4000000; i++){
            //firstNumber  = firstNumber + i;
            //System.out.println("fibo" + i);
            series[i] = series[i-1] + series[i-2];


            if(series[i] %2 == 0) {
                sum = sum + series[i];

            }

        }

        for(int j=0;j&lt;length; j++){
            System.out.println("fibo Series" + series[j]);
        }               

    }

}
</code></pre>

<p>I got the answer, but the approach was different. What's wrong with this code?. Can anyone give an insight on this.</p>

<p><strong>The same code works when the length is 10.</strong> I am not getting any expection on this, but the answer seems to be different. Its something -92719184589087346 which is incorrect.</p>
