Iterating over Java collections in Scala

前端 未结 9 1501
不思量自难忘°
不思量自难忘° 2020-11-28 02:19

I\'m writing some Scala code which uses the Apache POI API. I would like to iterate over the rows contained in the java.util.Iterator that I get from the Sheet

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 02:54

    As of Scala 2.8, all you have to do is to import the JavaConversions object, which already declares the appropriate conversions.

    import scala.collection.JavaConversions._
    

    This won't work in previous versions though.

提交回复
热议问题