#polymorphism Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Kotlin Enums with Properties and Methods
Kotlin enums can carry constructor properties and define methods — including abstract methods overridden per constant. Way more expressive than Java enums.
Rust Trait Objects (dyn Trait)
When you need a heterogeneous collection — different concrete types behind one trait — use `Box<dyn Trait>`. Costs one indirection (vtable) but enables polymorphism that `impl Trait` can't.