First of all, I am aware of the question : What does it mean for a function to return an interface?
But I am still a bit confused about the usage of a method returning a type "interface".
When would I use something like this?
public Animal saySomething(String str);
Could someone please provide an example of when / where to declare the saySomething() method returning a type interface.
Thanks!
Edit:
My question seems to be confusing to some. So I will try to re-word it. I am asking for an example of how I would use and when I would use a method that returns an interface type. Eventually I found a good example and submitted it as my own answer.