I can see that there are ways to convert from a Java list to a Scala seq (using asScala
method) but I could not find any converters for java.util.Vector
.
Is there a similar way for this conversion too?
JavaConverters
is a bit more idiomatic than JavaConversions
.
import collection.JavaConverters._
val v = new java.util.Vector[Int]
val s: Seq[Int] = v.asScala
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With