Java printing array error
<p>Im a newbie to Java and wrote this class to try few array options..can you please what is the error in the method printarray..Eclipse points me a error but im unable to debug</p>

<pre><code>public class arrarytest {
public static void main(String args[]){
    int[] x = {1,2,3,4};
    for(int y:x){
        System.out.println(y);
    }
    double[] mylist = {1.9,2.9,3.9,4.9};

    for (int i =0; i&lt;mylist.length; i++){
        System.out.println(mylist[i]);
    }

    double total = 0;
    for (int i =0; i &lt; mylist.length; i++){
        total +=mylist[i];
    }
    System.out.println("Total is="+ total);

    public static void printArray(int[] array) {
          for (int i = 0; i &lt; array.length; i++) {
            System.out.print(array[i] + " ");
          }
        }

}
}
</code></pre>
