Java is used in conjunction with Scala:
The list of Java and the conversion of the Scala buffer:
The premise is that the converted Java type and Scala type must also be import, then import Scala.collection.javaconversions._, and the set of conversions must have a definite type
?
Import Scala.collection.javaConversions.bufferAsJavaList
Val javalist = new Processbuilder (ArrayBuffer (1))//It will return a Javalist object
Import Scala.collection.mutable.ArrayBuffer
Val Buff:buffer[int] = new Java.util.arraylist[int] ()//It will automatically turn into Buffer
Import Scala.collection.javaConversions.mapAsScalaMap
Val scalamap = new Java.util.treemap[string,int]//It will automatically turn into a map in Scala
Import Scala.collection.JavaConversions.propertiesAsScalaMap
Val scalamap = system.getproperties ()//It will automatically turn into a map in Scala
Import Scala.collection.javaConversions.mapAsJavaMap
Import Java.awt.font.textattribute._//Introduce the key that will be used in the map below
Val Font = new Java.awt.Font (Map ("1" and 1, "2", 2))//The method expects a Java mapping
Scala's interoperability with Java