Problem with my for loop. I have never used this type before and it's not working like a regular loop
<p>I have a Project class that holds a name and various other attributes. Everytime a new Project is made it is added to an ArrayList. </p>

<pre><code>ArrayList&lt;Project&gt; mProject = new ArrayList&lt;Project&gt;();
</code></pre>

<p>I have most of the code in a different question. I don't feel like I should ask it there as it has a different question on it. But if you want to check out more of the code it's here:</p>

<p><a href="http://stackoverflow.com/questions/6433576/can-i-use-a-method-from-a-different-class-that-i-have-added-to-an-arraylist">Can I use a method from a different class that I have added to an ArrayList?</a></p>

<p>And here is where I'm stuck. This is the first time I've used this type of loop before and I don't know what's going on. I have seen tutorials just pass over this loop with a "you should know what happens here" attituded. So if you could explain this loop that would be great also. </p>

<p>And on to the code:</p>

<pre><code>System.out.println("Select one of the fallowing projects:");    
for (Project proj : mProject){
    int i= 1;
    i++;
    System.out.println( i + ": " + proj.returnName());
}
</code></pre>

<p>My output is this:</p>

<p>Select one of the fallowing projects:</p>

<p>2: Greg</p>

<p>2: Mike</p>

<p>It looks like it's not going though the code. So I'd love an explanation or a tutorial with this loop. Thanks. </p>

<p>If I use a regular loop how whould I go about using the methods from the mProject arraylist?</p>

<pre><code>for ( int i = 0; i&lt;= mProject.size() ; i++){
    Project proj = mProject;// This won't compile. 
        if (choice ==  proj.returnName()){                  
        }
}
</code></pre>
