Function override-overload in Java

后端 未结 6 2156
庸人自扰
庸人自扰 2020-12-05 21:18

What is the difference between override and overload?

6条回答
  •  爱一瞬间的悲伤
    2020-12-05 21:34

    • Overloading of methods is a compiler trick to allow you to use the same name to perform different actions depending on parameters.

    • Overriding a method means that its entire functionality is being replaced. Overriding is something done in a child class to a method defined in a parent class.

    src: http://www.jchq.net/tutorial/06_02Tut.htm

提交回复
热议问题