3 ms·
Imagine a struct with functions that don't have an implementation: that's an interface. If it has some implementations and some without, it's an interface with
by hota_mazi 9y ago
Imagine a struct with functions that don't have an implementation: that's an interface.
If it has some implementations and some without, it's an interface with default implementations.
See how Kotlin does it, it's really nice and consistent, and you never need to agonize over the decision of picking a class or a struct.