I used a scala immutable map as per below.
val d = "4.55"
This is working fine.
val properties = Map("title"->"title" , "value" -> d )
Its convert from [String , AnyRef] to [String, Any]
val properties = Map("title"->"title" , "value" -> d.toDouble )
Cant convert from Double to Object , runtime error
val properties:Map[String,Object] = Map("title"->"title" , "value" -> d.toDouble )
Why object cant accept the Double?
Working fine.
val properties:Map[String,Object] = Map("title"->"title" , "value" -> d.toDouble.asInstanceOf[Object] )
Cant understand the four scenario of Immutable Map behaviour.
val properties[String, Object] = ...
is not a valid Scala syntax – Oleg PyzhcovtoDouble
returnsDouble
and notjava.lang.Double
. – Alexey Romanov