On Thu, May 19, 2016 at 4:46 PM, 윤형덕 <ynoo...@naver.com> wrote: > > how can this.mainClass that doesn't override getPlan method that is abstract method of Program interface(program.class) and has only static main method be instantiate as Program?
This is only called if the class is actually a subclass of Program. That's why there is the `isAssignable` check. Otherwise, we check that there is a mainMethod (else if (hasMainMethod(mainClass)). If this is not the case, a ProgramInvocationException is thrown.