title: Arrays- Square root of an Array and printing the result JAVA
body: <p>I'm trying to get an array of (9) numbers square rooted then printed but I keep coming back with only one result - the number of numbers in the array squared- obviously not what I want.  Thanks for any help.  Ok, here is my terrible code so far.  Trying to pass it to a method as well.</p>
  
  <pre><code>public static void main ( String args[] )
  { 
   double[] nums  = {126, 12.939, 795, 320.16,
               110, 34.7676, 7773, 67, 567, 323};
  
  System.out.println ("Square root is " +square);
  square(nums);
  } 
  
  public static double square (double [] array) {
  double result;
  for( double i = 0; i &lt; array.length ; i++ )
    result = Math.sqrt(array[i]);
  
  return result;
   }
  }
  </code></pre>