title: How to divide a series of values in one array by a series of values in another array
body: <p>I am a beginner in Java and would like to ask some help with a array problem I am having. I am trying to build a simple program that has two int type arrays with 5 integers in each array. I want to divide the length of integers in one array by the length of integers in the other array. My program seems to work to some extent, since it gives me the results of the divisions. However it also gives me the following error:</p>
  
  <p>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
      at ArrayDivide.main(ArrayDivide.java:11)</p>
  
  <p>Can someone tell me once going wrong? Here is my code: </p>
  
  <pre><code>public class ArrayDivide {
  
      public static void main(String[] args) {
  
          int arr1[]={8,4,6,8,4};
          int arr2[]={2,4,2,1,2};
  
          for (int x =0;x &lt;arr1.length;x++){
              for (int j =0;x &lt;arr2.length;j++){
                  int result = arr1[x] / arr2[j]; 
  
                  System.out.println(result);
  
              }
          }
      }       
  }
  </code></pre>