Using scala map in Java
问题 I have two files. One is scala and other is java. Scala file has a function which returns scala immutable map. Java file wants to use that map as dictionary. I am a newbie to scala and java. How can I convert that scala map to java dicionary? 回答1: Use the static forwarders from Java. In Scala 2.13 the API is simplified, with overloaded asJava for conversion to Java: $ javap -cp ~/scala-2.13.0/lib/scala-library.jar scala.jdk.javaapi.CollectionConverters Compiled from "CollectionConverters