Out Of Bounds Exception, when trying to print array
<p>I have this problem, been stuck for hours now. </p>

<p>This method is getting out of bounds exception when i try to print it.
Im using the input variables from the method posted below this. Thanks!</p>

<pre><code>public static double [] calcLine(double x, double k, double m){
    double tx = 1;
    double[] list = new double[(int) x]; 
    for(double i =1; i &lt;= 5; i++){

        list[(int) i]+= calcPoint(tx,k,m);
        tx++;
    }

        return list;

}
</code></pre>

<p>This is the calcPoint method i use;</p>

<pre><code>public static double calcPoint(double x,double k, double m){

    double calcPointInput = k*x+m;
    return calcPointInput;
}
</code></pre>

<p>Cheers L</p>