So now did we know about these powerful features an obvious question is why would we use that.
Why why is that helpful.
Well it is useful in situations like this where we know we want to have a certain set of functionalities
let's say agreat method and we want to ensure that a class has such agreed method and a number of class
has it maybe as well.
Well then we can implement an interface which forces the existence of this method.
So then we can easily share functionality amongst classes and every class has to add its own implementation
the exact code that should execute when the method is called.
But we enforce a certain structure with the help of interfaces and this can be useful if we then have
other parts of our code which rely on that structure.
Here we said user 1 to be of type readable and with Dad we say we don't care what's inside user but
what has to be in there is agreed method and we know that it has to be in there because whatever we
store in user one has to be readable.
And that allows us to write truly powerful and flexible code where we don't have to know everything
about an object or everything about a class but we just know whatever I'm getting here and user one
has to have a great method.
We don't care whether a person has anything else here.
We're interested in great hands who sent us to readable and therefore we can't store anything in user
1 which would not have agreed method because readable force says whatever you base on it to have such
a read method.