So, yes I've seen this question. However, what if I had two interfaces, IA
and IB
, but I wanted a parameter to a function (or property of a class) to be:
public void (<? extends IA, IB> someClass) {
//...
}
Is there a way to do this without using generics?
EDIT:
I've realized that what I really want is Duck Typing, like in Python. I just didn't get my words out right. With that in mind, clearly there is no real way to do this in Java. I accepted this answer, but then realized that the input would have to have the signature of that new interface
to work. However, he did meet my awkwardly-worded criteria :).