 <p><code>import java.util._</code> overrides <code>scala.collection.Iterator</code> (which available by default via type alias in <code>scala</code> package object) with <code>java.util.Iterator</code>. Just change your import to <code>import java.util.Scanner</code></p>