title: how to compare an string array?
body: <p>i have this code example. I want to compare to strings that contains paths. The problem is at the else part...in this example they have / and usr together..and i want to compare the length after that point where they are different..thank you for your help</p>
  
  <pre><code>String path1 = "/usr/libexec/warmd";
  String path2 = "/usr/lib/libOpen/xy";
  
  String[] test1 = path1.split("/");
  String[] test2 = path2.split("/");
  
  ArrayList&lt;String[]&gt; path1array = new ArrayList&lt;String[]&gt;();
  ArrayList&lt;String[]&gt; path2array = new ArrayList&lt;String[]&gt;();
  path1array.add(test1);
  path2array.add(test2);
  
  int len1 = test1.length;
  int len2 = test2.length;
  int len;
  if (len1 &lt;= len2) {
      len = len1;
  } else
      len = len2;
  for (int i = 0; i &lt; len; i++) {
  
      if ((test1[i]).equals(test2[i])) {
          continue;
      } else
          break;
  }
  </code></pre>