If I have a method that has as argument a Base class type I can pass it every object of a class that has extended that base class because a derived class is also a base class.
So if I have a method that has as argument an Interface type I can pass it every object of a class that has implemented that interface because that class is also an interface or all the interfaces it can implement.
Is that the correct terminology to use with the interface?
Thanks.
Correct terminology would not be
that class is also an interface
but
that class can behave exactly as the interface promises
instead.
With bases classes, it is like “I can work with any hard worker.” With interfaces, it is like “I can work with anything that works hard.”