巴扎黑2017-04-17 13:58:59
If you are sure to execute test.eat(); when using the framework and no error is reported, it is indeed interesting.
It is also possible that the framework swallowed the exception and threw it upward
ringa_lee2017-04-17 13:58:59
Try it and NPE will appear
http://www.tutorialspoint.com/compile_java_online.php?PID=0Bw_CjBb95KQ...
阿神2017-04-17 13:58:59
I dare say that you must have not read the code. If it returns a null, then this is completely meaningless code. If this is really the case, is it normal if you delete the project...
The getModel method must return the object implemented by the interface.
You can search for the class that implements that interface. Take a closer look at the configuration file of the class related to the getModel method.
Look carefully... nothing so magical will happen...
PHP中文网2017-04-17 13:58:59
Cannot be empty. If no error is reported, the framework must have caught the exception handling for you.
ringa_lee2017-04-17 13:58:59
I think you may have followed the wrong code. You can see what you get after executing ITest test = Model.getModel();
by debugging with breakpoints