Scala数组 转 Java List
// scala版本 2.13.1
import scala.jdk.CollectionConverters.BufferHasAsJava
val arr = ArrayBuffer("1", "2", "3")
val list: java.util.List[String] = arr.asJava
println(list) // [1,2,3]
List 转 Scala数组
// scala版本 2.13.1
import scala.jdk.CollectionConverters.CollectionHasAsScala
val scalaArr: mutable.Buffer[String] = list.asScala.toBuffer
scalaArr.append("20")
println(scalaArr) //ArrayBuffer(1, 2, 3, 20)