title: I want a method that accepts an array, low number, high number. and returns an array with only numbers in between that
body: <pre><code>  public static int [] filterRange(int [] array, int low, int high){
        int numbers = 0; 
        for (int i = 0; i &lt; array.length; i++){
            if (i &lt;= high &amp;&amp; i &gt;= low){
                numbers ++; 
            }  
        }
        int array1 [] = new int [numbers]; 
        for (int i = 0; i &lt; array.length; i++){
            if (i &lt;= high &amp;&amp; i &gt;= low){
                array1[i] = array[i];
            }
        }
  
        return array1;
    }
  </code></pre>
  
  <p>I'm trying to write a method that doesn't use any built in functions. It accepts an array of numbers, a low value , and a high value and returns a new array that has only the numbers in between  the high and low value, as well as the high and low value if applicable. </p>
  
  <pre><code>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
  at Question_1.filterRange(Question_1.java:41)
  at Question_1.main(Question_1.java:13)
  </code></pre>
  
  <p>This is the error message I'm getting. </p>