How to convert a java.util.List to a Scala list
You can simply convert the List using Scala's JavaConverters
:
import scala.collection.JavaConverters._
def findAllQuestion():List[Question] = {
questionDao.getAllQuestions().asScala.toList
}
import scala.collection.JavaConversions._
will do implicit conversion for you; e.g.:
var list = new java.util.ArrayList[Int](1,2,3)
list.foreach{println}