Add two arrays Java
<p>I want to add elements of two array in Java. I wrote this code:</p>

<pre><code>public static void sum (int [] a; int [] b){

    int sum=new sum[a.length];

    for (int i=0;a.length;i++){
        sum[i]=a[i]+b[i];
    }
}
</code></pre>

<p>this code doesn't work, because sum only the first element of two arrays. How can I solve this problem?</p>