Can I access a field of an object:abstract class?

For example, in the following example, how can I printdog‘s ownerName?

abstract class animal { abstract val name:String; } val dog = object: animal(){ val ownerName = "Tom"; override val name = "Good boy"; } fun main(args: Array<String>) { println(dog.ownerName); } 

submitted by /u/evolution2015
[link] [comments]