java.lang.ArrayIndexOutOfBoundsException 2 out of 2 : <p>Can you please help I am new to proggraming and I don not even no what this error is caused from here is my code. I am trying to make a working Resistence formula but its not working.</p>

<pre><code> int n=kb.nextInt();
        double massiv[]=new double[n];
        for(int i=0;i&lt;=massiv.length;i++){
            massiv[i]=kb.nextDouble();
        }
        for(int i=0;i&lt;=massiv.length;i++){
            gr=massiv[i]*gr;
            dr=massiv[i]+dr;
        }
        Re=gr/dr;
        System.out.println(+Re);
</code></pre>
