Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
<p>I get the message in the title when I try to use this method, but I can't find out why. Anyone who can help me?</p>

<p>Thanks!</p>

<pre><code>void companyInfo() {
    int tel = 0;
    System.out.print("Name of company: ");
    String tmpCompany = sc.next();
    for (int i = 0; i &lt; tel; i++){
        if (tmpCompany.equals(null)){
        }
    }
    for (int i = 0; i &lt; 10; i++) {
        int count = 0;
        for (int j = 0; j &lt; field.length; j++){
            for (int k = 0; k &lt; field[k].length; k++){
                if (tmpCompany != (null) &amp;&amp; field[i][j] != 0 &amp;&amp; tmpCompany.equals(felt[i][j])){
                    count++;
                }
            }
        }
        if (tmpCompany != null &amp;&amp; count &gt; 0) {
            System.out.print("The company " + tmpCompany + " owns " + count + " field(s).");
        }
    }
}​
</code></pre>
