title: Return array method, error
body: <p>I am trying to write a method that takes two arrays as parameter, and than return the sum of them. But I have two problems firstly I have error now that is saying incompatible types and is showing the error at return s. The other question is how to add 0 values to one array if it is shorter than the other.</p>
  
  <p>Cheers.</p>
  
  <pre><code>public class Question1d{
      public static void main (String [] args){
          double[] v = {1, 2, 3, 4, 5};
          double[] w = {5, 4, 3, 2, 1};
          double[] s;     
      }
  
      public static double add(double[] v, double[] w){
          int a;
          if (v.length &gt;= w.length){
              a = v.length;
          }
          else{
              a = w.length;
          }
          double[] s = new double[a];
          for(int i = 0; i&lt;=a; ++i){
              s[i] = v[i] + w[i];
          }
          return s;
      } 
  }
  </code></pre>