Answer the question
In order to leave comments, you need to log in
Class into method argument how to do?
public static void SetExecutor(String cmd, Class cls) {
this.getCommand(cmd).setExecutor(new "class_name"());
}
Answer the question
In order to leave comments, you need to log in
Without reflection, in any way, and it is better not to use reflection. The code looks type-unsafe. It's better to pass an interface instance or a reference to an interface constructor.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question