title: Comparing each element in of two arrays
body: <p>Here's my problem:</p>
  
  <blockquote>
    <p>Write a method called <code>allLess</code> that accepts two arrays of integers and returns true if each element in the first array is less than the element at the same index in the second array. Your method should return false if the arrays are not the same length. </p>
  </blockquote>
  
  <p>Here is my test data:</p>
  
  <pre><code>int[] arr1 = {1,2,4}; 
  int[] arr2 = {3}; 
  int[] arr3 = {5,4,6}; 
  int[] arr4 = {2,2,7}; 
  int[] arr5 = {2,3,6,8}; 
  
  System.out.println(allLess(arr1,arr2)); //should print false 
  System.out.println(allLess(arr1,arr3)); //should print true 
  System.out.println(allLess(arr1,arr4)); //should print false 
  </code></pre>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>public static boolean allLess(int[] a, int[] b){
      int len1=a.length;
      int len2=b.length;
      if(len1==len2){
          for(int i=0; i&lt;len1;i++)
              if(a[i]&lt;b[i])
                  return true;
      }
      else if(len1 !=len2)
          return false;
      return false;
  }
  </code></pre>
  
  <p>However, when I try <code>System.out.println(allLess(arr1,arr4));</code> it's  printing true.  How do I fix this?</p>