Java map转scala map

public static void main(String[] args) {
    Map, String> map = new HashMap,String>(){{put("1","2");}};
    scala.collection.mutable.Map, String> mapTest = JavaConverters.mapAsScalaMapConverter(map).asScala();
    Object objTest = Map$.MODULE$.,String>newBuilder().$plus$plus$eq(mapTest.toSeq());
    Object resultTest = ((scala.collection.mutable.Builder) objTest).result();
    scala.collection.immutable.Map,String> resultTest2 = (scala.collection.immutable.Map)resultTest;
    System.out.println(resultTest2.keySet());

}


感谢 scala中国 群里的:
 _森_ 
不明所以的吃瓜群众 wxk

你可能感兴趣的:(java,scala)