Kotlin interfaces
An interface is like a class. Phew! Nothing complicated here then. But, it's like a class that is always abstract, and only has abstract functions.
We can think of an interface as an entirely abstract class, with all its functions and properties being abstract. When a property is abstract, it does not hold a value. It has no backing field for the property. However, when another class implements (uses) the interface, it must override the property, and therefore provide the backing field for storing a value.
Simply put, interfaces are stateless classes. They provide an implementation template without any data.
OK, so you can just about wrap your head round an abstract class, because at least it can pass on some functionality in its functions and some state in its properties that are not abstract and serve as a polymorphic type.
But, seriously, this interface seems a bit pointless. Let's look at the simplest possible example of an interface, then we can discuss it further.
To...