please note: this link didn't help How can I get a list of all the implementations of an interface programmatically in Java
Hi I wonder how to load all types in code that Implements a generic interface without using external libraries from java?
for example how to load all types that implemets this interface & create them?
public interface MyInterface<TInput> {
Void Foo(TInput input);
}
because this is generic interface I cannot code: MyInterface.class
can I do something like
ServiceLoader<Abc> loader = ServiceLoader.load(Class<? implements MyInterface<Integer>.class);