Do you have any clue about how to write such method?
public abstract class AbstractClass{}
public class TrialClass extends AbstractClass{
public TrialClass(final String a, final String b){}
public TrialClass(final String a, final String b, final String c){}
}
public class getNewInstance(final Class<? extends AbstractClass> clazz, Object... constructorParameters){
//???
}
TrialClass trialClass = getNewInstance(TrialClass.class, "A", "B");
Aucun commentaire:
Enregistrer un commentaire