I don’t know why I can’t find an answer to this online.
I have classes that implement multiple methods and I would like to write methods to expect them. I don’t know how to do it though or if it’s even possible.
E.g:
public void yellAtPet(<? extends Pet implements YellableAt> arg) {
arg.yellAt("Don't go there!");
arg.pet("Good Boy");
}
This should work fine as a generic method, without making your entire class generic: