title: Using second method to get the average of an Array
body: <p>I am trying to implement two methods: a <code>main</code> method and another side method. The side method does the math to get the average of the Array, which is located in the main method itself. It then returns it to the main method.</p>
  
  <pre><code>import java.util.*;
  public class ArrayAverageDouble
  {
      public static void main(String[] args) 
      {
          Scanner sc = new Scanner(System.in);
  
          double average=0;
          int i=0;
          double sum=0;
          int size = 0;
  
          System.out.println("What size do you want the Array: ");
          size = sc.nextInt();
  
          double arrayDouble[] = new double[size];
  
          for (i = 0; i &lt; arrayDouble.length; i++) 
          {
              System.out.println("Enter a number");
              arrayDouble[i]=sc.nextDouble();
          }
  
         System.out.println("The average of ' arrayDouble ' is: " + average);
  
          sc.close();
      }
  
      private static void avgInt(double[] arrayDouble)
      {
          average = ?
          return average;
      }
  }
  </code></pre>