Consider the following classes and interfaces in java.
A
public interface A{
}
B
public class B implements A{
}
C
public class C implements A{
}
Some Client
main(){
//variable to refer to only a class which implements A interface
Class<? implements A> clazz;// this is giving compile errors
}
Question
Class<? implements A> clazz;
is giving compile errors. how do i represent a variable to hold a class which implements an interface A.
PS: i know about <? extends A>
and <? super A>
. But need an analogous one for interface.