Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Explain overridig with example 2011
#1
please explain overridig with examples
Reply
#2
The Concept of Overriding is related with Inheritance.
You know that in inheritance, derived class has right to own all the data and behavior of its base class. It is seen practically that at least one situation might be occure among the below listed, while in inheritance under the concept of Overriding a function.

1- Derived class uses the overrided function as it is, from base class
2- Derived class extends somehow the behavior of Overrided function as per its needs
3- Derived class restrict somehow the behavior of Overrided function as per its needs.

Secondly, as you also know very well that Inheritance "is a" relationship i.e Triangle is a Shape, so in this sentence Triangle is the derived class of Shape.

Definitely, Triangle owns all the functionality of its base class Shape. Lets suppose there is a function” Draw" in its base class that can be accessed by an Object of Triangle and use it. But, in order to draw a triangle , some extension is required in the function Draw. So, this extension in the function of base class that is used by derived object as per needs is called extension in the existing functionality and is also known as sub typing.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dangling Pointers Explain in C++ Vuhelper 0 7,262 05-31-2012, 01:52 AM
Last Post: Vuhelper
  Explain the difference b/w Null Pointer and Null Nodes? C++ 2012 Vuhelper 0 1,950 01-06-2012, 12:24 AM
Last Post: Vuhelper
  explain this operator -> which is use as headnode->stnext(null); Vuhelper 0 1,723 01-04-2012, 10:26 PM
Last Post: Vuhelper
  array project code c++ 2011 Vuhelper 0 1,272 12-10-2011, 06:32 PM
Last Post: Vuhelper
  factorial in C++ code 2011 Vuhelper 0 943 12-10-2011, 06:31 PM
Last Post: Vuhelper
  stack during function call in C++ 2011 Vuhelper 0 2,025 11-05-2011, 05:05 PM
Last Post: Vuhelper
  What is the Thing Queue? in c++ 2011 Vuhelper 0 1,785 11-05-2011, 05:02 PM
Last Post: Vuhelper
  ASCII to char conversion code in C++ 2011 Vuhelper 0 1,720 11-05-2011, 05:01 PM
Last Post: Vuhelper
  How to write a summation in a sequence? C++ 2011-12 Vuhelper 2 1,355 09-19-2011, 04:53 AM
Last Post: Xpert
  GetPixel problem in c++ 2011-12 Vuhelper 0 2,504 09-18-2011, 07:12 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)