2
import com.alibaba.fastjson.JSON
object test {
def main(args: Array[String]) = {
val map = new util.HashMap[CharSequence, CharSequence]()
map.put("123", "22333")
map.put("test", null)
val ret = JSON.toJSONString(map)
println(ret)
}
}
toJSONString
functiones :모호한 참조 할 때 자바 라이브러리의 호출 방법
오류 : 어떤 이유
Error:ambiguous reference to overloaded definition,both method toJSONString in object JSON of
type (x$1: Any, x$2: com.alibaba.fastjson.serializer.SerializerFeature*)String
and method toJSONString in object JSON of
type (x$1: Any)String
match argument types (java.util.HashMap[CharSequence,CharSequence])
val ret = JSON.toJSONString(map)
https://issues.scala-lang.org/browse/SI-8344 여기서'f (a, b, c)'는'f (Tuple3 (a, b, c))'로 간주 할 수 있습니다. –