As shown here, https://stackoverflow.com/a/16639438/8949356, in Java you can override the function of a declared class when it is public
But I want to know how to do this exact same code in Kotlin, I've tried a lot but haven't found anywhere something on this topic. And I could just go and do this in Java but the rest of my code is in Kotlin, plus I just can't stay with this kind of doubt; Kotlin feels like a great tool to me and want to learn it all.