Unclear about Java
<p>This maybe a stupid question. I am still getting learn and understand java. I have a concern that is getting me confused. I have a text document that has about 50 lines of info. </p>

<p>My concern is that I am trying to retrieve information on certain names and calculate the values next to their names as a total. Meaning if the doc is about baseball teams and their averages. I would like to calculate only those teams that belong to a certain division. </p>

<p>I have this code that helps me to calculate all.</p>

<pre><code>public int totalAverage( ) {
    int total = 0;
    for ( int i = 0; i &lt; teamArray.length; i++ ) {
        total += teamArray[i].getAverages( );
    }
    return total;
}
</code></pre>
