Be sure that an input parameter fulfills multiple type criteria
I have two interfaces, A and B. I'm writing a function, and I want it to
only take in objects that use both interfaces. This is some of the things
I've been trying. I hope my question is clear.
public void function((? implements A,B) thing) {
// do things
}
public <T extends A, T extends B> void function(T thing) {
// do things
}
public <T extends A,B> void function(T thing) {
// do things
}
None of these attempts worked though. Thanks in advance for any insight
into this.
No comments:
Post a Comment