https://kotlinlang.org logo
#getting-started
Title
# getting-started
e

Everett Corvid

11/16/2023, 1:29 AM
I wonder, one of my favorite features in rust is the ability to do object polymorphism in both directions; You could create a superclass then derive it with subclasses, or you could create attributes and assign them to any subclass of a superclass, or any class which implements other attributes you define, or create subclasses of ANY class which implements an attribute, and you can use those attributes to dynamically add or override member functions or member variables of classes. Is there anything like this in Kotlin? Can I dynamically add member functions or member variables to a class or instance without needing to statically specify what the superclass is?