What is the difference between overloading and overriding?
Ans : Overloading occurs when two or more methods use the same name (but different parameter lists), such that both methods are available side by side in the same class; overriding occurs when a subclass method and a superclass method use the same name (and matching parameter lists), such that the subclass method blocks out the superclass method. Overloading and overriding are often confused with each other, because the words are similar and because they both involve a single method name referring to potentially several different method implementations. There are clear differences, however, when you compare the two point by point, as done in Table 1.4. Table 1.4: Overloading versus Overriding Overloading Overriding relationship between methods available in the same class relationship between a superclass method and a subclass method does not block inheritance from the superclass blocks inheritance from the superclass separate methods share (overload) the same name subclass method repla