Is it possible to get a list of all the interfaces that extend the base interface without any bean having implemented any interface in java at runtime ?
Example:
interface A {}
interface B extends A{}
interface C extends A{}
interface D extends C{}
public Class<? extends A>[] getAllInterfaces(A.class);
The method getAllInterfaces()
should return all interfaces that extend A: {B, C, D}
source
share