Explain the difference between method overloading and method overriding
Method overloading is to define two or more methods with a same name, a different return value and different number/type of arguments within the same class.
On the other hand, method overriding is to define methods with the same signature both in the superclass and a subclass. A method defined in a subclass overrides the method in the superclass.
Remarks
Text provided above does not means is the
model answer, and it's was posted here for an reference to somebody who
interested the related knowledge only. if there is something incorrect,
please leave a comment so that i can correct it or for others viewer to
have an better reference, if you want know more about this topic and
where is the question, concept or answer from, you can reference from
information provided under the reference sub-title.
Reference:
1) Introduction to Java Programming, Y. Daniel Liang
2) http://www1290ui.sakura.ne.jp/index.php?plugin=attach&refer=UMUC%20Asia%20-%20CMSC335%20-%20Object-Oriented%20and%20Concurrent%20Programming&openfile=CMSC335_Homework2.pdf
No comments :
Post a Comment