title: How can I use the java for each loop with custom classes?
body: <p>I think most coders have used code like the following :</p>
  
  <pre><code>
  ArrayList&lt;String&gt; myStringList = getStringList();
  for(String str : myStringList)
  {
     doSomethingWith(str);
  }
  </code></pre>
  
  <p>How can I take advantage of the for each loop with my own classes? Is there an interface I should be implementing?</p>