Actual Question:
hai,
what is the meaning of replacement and refinement.
replacement and refinement are also called as overloading and overriding is it correct,please clear this.
Hi Ramchander,
You are completely mistaken. Replacement & Refinement are not equal to Overloading and Overriding respectively.
Infact both are types of Overriding only i.e comes in inheritance.
Replacement meand a derived class defines a new method whose signature is exacltly similar to the base class method i.e it replaces the base class body with a new one hence the name.
where as, refinement preserves the body of the base method, and enhances(adds some more code)the base method i.e it refines the base class method hence the name.
In summary, in Replacement base method code is hidden by the derived code, where as in Refinement base method body is enhanced by preserving it.
In general, in both languages C++ &
java default it is Replacement.
hope this helps.
-prakash