For example I’d like to have this to work the way to set jDName to “John Doe” and jDAge to 32:
case class Person(name : String, surname : String, age : Int)
val johnDoe = Person("John", "Doe", 32)
val jDName : String = johnDoe
val jDAge : Int = johnDoe
Can I write functions in the Person class to provide implicit conversion to String, Int and other (custom) types? And another thing is for explicit cast operation – also interesting, but I don’t know exactly how should I write this for an example in Scala.
Sure, put them in the companion object.