props.put("retries", 3)
报错,对于这种字面值如何指定类型呢?
Error:(13, 24) type mismatch;
found : Int(3)
required: Object
Note: an implicit exists from scala.Int => java.lang.Integer, but
methods inherited from Object are rendered ambiguous. This is to avoid
a blanket implicit which would convert any scala.Int to any AnyRef.
You may wish to use a type ascription: `x: java.lang.Integer`.
props.put("retries", 3)
只能按照使用一个临时变量吗? val x : java.lang.Integer = 3
有没有其他更加优雅的写法呢?
MM们
元芳怎么了
相关分类