<Simple casting in Kotlin/Java> I have an object U...
# stackoverflow
u
Simple casting in Kotlin/Java I have an object User defined as below class User(){ var id: Int? = null var name: String? = null} For certain reasons, I have to create new object User of same parameters and I have to copy data from old to new type. class UserNew(){ var id: Int? = null var name: String? = null} I was looking for easiest way to convert from old type to a new one. I want to do simply var user = User() var userNew = user as UserNew But obviously, I am getting This cast can never...