title: Scala loops with multiple conditions - what gets returned?
body: <p>I'm going through scala for the impatient and came across an example of the multi condition loops that I can't seem to understand. </p>
  
  <p>Coming from Java background I'm looking at these loops as nested for loops. But why does the first return a <code>collection</code> and second a <code>String</code>?</p>
  
  <pre><code>scala&gt; for (i &lt;- 0 to 1; c &lt;- "Hello") yield (i + c).toChar
  res11: scala.collection.immutable.IndexedSeq[Char] = Vector(H, e, l, l, o, I, f, m, m, p)
  
  scala&gt; for (c &lt;- "Hello"; i &lt;- 0 to 1) yield (i + c).toChar
  res12: String = HIeflmlmop
  </code></pre>