What is the difference overloading (Overload) and rewritable (Override) is?

  First run java program is divided into two parts, compile and run.

  So overloaded and rewritten at this point there is a very clear distinction, because the method name and number of parameters override the methods are the same type, so at compile java virtual machine is not rewritten identify different methods, in it can be seen that different points during the run. The reload the compilation process has exposed his differences, though the method names are the same, but the number of parameter types are different. Simply put, that is, the compiler can distinguish a different one can not distinguish between different.

  Also for java polymorphism is rewritten, rather than overloading, just as archery, rewriting is a shot arrow on a bow, the arrow may vary, it is a heavy-duty shoot a lot of Arrows bow.

Guess you like

Origin www.cnblogs.com/ffdsj/p/12345420.html