0

So i have a function that takes a generic and a parameter. This generic is not an instance, but a typename. I need to call a static method of the class corrensponding to the typename.

public <T extends Base> void Process(Callback functionInterface)
{
  functionInterface.call(T.GetStaticParams());
}

I know that all possible T classes have a static method GetStaticParams(), but the Java compiler does not know how to find the function specified.

I have tried having GetStaticParams() in Base and all Children classes, but then only the method in the Base class gets called.

TheSnak7
  • 13
  • 5

0 Answers0