title: Beginner Java - looping through an array
body: <p>So this class is supposed to print out the largest number in the array defined under the main method (aka 22) however when I run it nothing happens.  I'm sure this is a very stupid question but today is my first day with java and I have already spent an embarrassing amount of time trying to figure it out.  Thanks!</p>
  
  <pre><code>  public class fun {
          public static void main (String [] args) {
          int[] numbers = new int[] {9, 2, 15, 2, 22, 10, 6};
          max(numbers);
          }
  
          public static int max(int[] m) {
              int length = m.length;
              int counter = 1;
              int currMax = m[0];
              while (counter &lt;= (length - 2)){
                  if (m[counter] &gt; currMax){
                  currMax = m[counter];
                  }
                  counter = counter + 1;
              }
              return currMax;
          }
      }
  </code></pre>