I have this Scala method with below error. Cannot convert into a Scala list.
def findAllQuestion():List[Question]={ questionDao.getAllQuestions() }
Starting Scala 2.13, the package scala.collection.JavaConverters is marked as deprecated in favor of scala.jdk.CollectionConverters:
Scala 2.13
scala.collection.JavaConverters
import scala.jdk.CollectionConverters._ // val javaList: java.util.List[Int] = java.util.Arrays.asList(1, 2, 3) javaList.asScala.toList // List[Int] = List(1, 2, 3)