Skip to content

Instantly share code, notes, and snippets.

@sjrd
Last active August 29, 2015 14:25
Show Gist options
  • Save sjrd/7e576814fb16b8623569 to your computer and use it in GitHub Desktop.
Save sjrd/7e576814fb16b8623569 to your computer and use it in GitHub Desktop.
Welcome to Scala version 2.11.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scala.collection.JavaConversions._
import scala.collection.JavaConversions._
scala> val list = new java.util.ArrayList[Int]
list: java.util.ArrayList[Int] = []
scala> val buf: scala.collection.mutable.Buffer[Int] = list
buf: scala.collection.mutable.Buffer[Int] = Buffer()
scala> scala.collection.mutable.ArrayBuffer(list: _*)
res0: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment