title: Sending multiple parameters to a method, and returning a value, Java
body: <p>I am new to programming. I came across this question:</p>
  
  <p>"Write a program which will fill three arrays a,b and c, all lengths is 8,with pseudo random integers between 2 and 10,including 2 but not including 10, and set the array elements of a fourth array, d, of length 8,to the sum of corresponding elements of a,b, and c, and output all four arrays as indicated below.get the three arrays (a,b,and c) generated in the main and pass to an non-main method to add the corresponding elements to determine the sum array(d) and return the sum array (d) to the main.with all four arrays outputting from the main."</p>
  
  <p>So far I have no problem creating the arrays a,b and c with random elements. But I do not know how to create d outside the main (how to send multiple parameters, how to return values to main). Please help!</p>
  
  <p>I tried something like this:</p>
  
  <p>What's wrong with this?:</p>
  
  <pre><code>public static void main(String args[]){
  //generated arrays a, b, c
          d[] = assemble (a, b, c);
      }
      public assemble (int a, int b, int c){
              int d = a + b + c;
              return;
      }
  }
  </code></pre>