I am making a Java program. The version of JDK is 1.8. I need to let the user implement an interface, and the implemented method will be called automatically. However, I don’t know how to get the implementation class based on the interface.
I tried Java SPI, but the user needs to write file in resource. But I want to implement the interface without any operation.
Any suggestion is welcome.