title: Average of integers not counting 0 as a number
body: <p>I am trying to find the average of an array of numbers, whose value is taken from a <code>JTextfield</code>. My problem is that zero is counted in with the average. How is it possible to find the average but not include zero.</p>
  
  <pre><code>int[] numbers = new int[]{Integer.parseInt(math1.getText()),0 };
  
  int sum =0;
  if(numbers != 0){
  
      for(int i=0; i &lt; numbers.length ; i++)
          sum = sum + numbers[i];
  
      //calculate average value
      int average = sum / numbers.length;
  
      totdata2.setText(Integer.toString(average));
  }
  </code></pre>