I have the following class and interface:
public class BasicObject{...}
public interface CodeObject{...}
I want to create a method in which the argument needs to be of type BasicObject and implements CodeObject. I tried the following code but it doesn't guarantee clazz to be a class that implements CodeObject.
myMethod(Class<? extends BasicObject> clazz){...}
I want to do something like this but it doesn't compile:
myMethod(Class<? extends BasicObject implements CodeObject> clazz){...}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…