title: Why won't my code print out the array?
body: <pre><code>public static int getNextLargest(int[] numArray, int searchNum)
      {for(int i:numArray){
         out.println(i);
         if(searchNum &lt; i){
             numArray.add(i);
         }
     }
  
      return -1;
  }
  </code></pre>
  
  <p>It does exactly what I want it to do except for adding what is stored in i to an array. I have also tried numArray[i], it won't work either.</p>