title: Foreach loop in Java doesn't work
body: <p>I am trying to create a for-each loop in Java that iterates on every character in a string. When I try to do this I get an error in NetBeans:</p>
  
  <pre><code>for-each not applicable to expression type
  required:array or java.lang.Iterable, found java.lang.String
  </code></pre>
  
  <p>This is the Java code on which I get an error:</p>
  
  <pre><code>for(char c : fen){
  }
  </code></pre>
  
  <p><code>fen</code> is a String</p>
  
  <p>I am trying to understand the source code of a game writen in C# and the foreach loop there worked:</p>
  
  <pre><code>foreach(char in fen){}
  </code></pre>