title: Removing and replacing arrays
body: <p>Basically, I am given an array of numbers and I have to count all the negative numbers.
  Then make a new array that contains all of the positive numbers from the previous with the length of the array being firstarray-numberOfNegatives</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public void removeNegatives()
    {
  
        int numberOfNegative = 0;
        for(int i = 0; i &lt; numbers.length-1; i++)
        {
              if (numbers[i] &lt; 0) numberOfNegative++;
        }
        int [] numbers2 = new int[numbers.length-numberOfNegative];
        int count = 0;
        for(int i = 0; i &lt; numbers2.length; i++)
        {
            if (numbers[count] &gt; 0) numbers2[i] = numbers[count];
            count++;
            System.out.println(numbers2[i]);
        }
        numbers = numbers2;
    }
  </code></pre>
  
  <p>I am getting the wrong result: negative numbers are replaced with 0s</p>