 <p>In Scala, a <code>List</code> is of immutable length. It can work like a <code>LIFO</code> (last in, first out) structure, but it cannot behave like a Java <code>ArrayList</code>.</p> <p>You are doing this:</p> <pre><code>val lst = List[Int]() </code></pre> <p>which gives your <code>lst</code> a size of <code>0</code>. It means you can't really do anything with it.</p> <p>For a mutable collection, use <code>ListBuffer</code>.</p> <p>Also, the <code>::</code> operator is right associative, which means it will be called on the object found on the right side of the operator.</p> <pre><code>val lst = ListBuffer[Int]() for (i &lt;- 0 until 100) { lst += i // will add to the tail. } </code></pre>