title: output blank--Java program to calculate average of array
body: <p>I am writing a program that takes 10 floating point numbers as inputs, and displays the average of the numbers followed by all of the numbers that are greater than the average. I am using a method that takes an array of doubles as a parameter and returns the average of the data in the array. However, my problem is that when I run my program the output window is completely blank. I assume this is because I did not call in my method to the main method. However, I am not sure how to write that code. Thank you. </p>
  
  <pre><code>import java.util.Scanner;
  
  public class Average {
  
  public static void main(String[] args) {
  }
  
  public double average(double[] number) {
      Scanner scanner = new Scanner(System.in);
  
      int x = 0;
      double sum = 0;
      double[] numberList = new double[10]; //array to hold all numbers
      double[] largerList = new double[10]; //array to hold numbers greater than the average
  
  
      int numberIndex = 0;
      int largerIndex = 0;
  
  
  
      System.out.printf("Please enter 10 floating-point numberes.\nIf more than 10 values are entered, the numbers following 10 are ignored.\nIf less than 10 numbers are entered, the program will wait for you to enter 10.\n");
  
      for (int i = 0; i &lt; 10; i++) {
  
  
          try { //try catch exception to catch decimal inputs as well as more /less than 10 integers
              x = scanner.nextInt();
              sum += numberList[x]; //add up all inputs to find sum
          } catch (Exception e) {
              System.out.println("Invalid input! Please reenter 10 integer values.");
              scanner = new Scanner(System.in);
              i = -1;
              numberIndex = 0;
              largerIndex = 0;
              numberList = new double[10];
              largerList = new double[10];
              continue;
          }
      }
  
      for (int i = 0; i &lt; number.length; i++) {
          sum = sum + number[i];
          double average = sum / number.length;
          System.out.println("Average value of your input is: " + average);
          System.out.println();
  
          //return average;
  
          if (x &gt; average) {
              largerList[largerIndex] = x; //add negative input to negativeList array
              largerIndex = largerIndex + 1;
  
          }
      }
  
  
  
      for (int i = 0; i &lt; largerIndex; i++) {
          System.out.println(largerList[i]);
      }
      return 0;
  
  
  
  
  
  }
  </code></pre>
  
  <p>}</p>