What is the difference between
extends(inheritance)
and
override(polymorphism)
?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Extends: we create a new class(Inherited class) with the features of Existing (class Base class) and some additional features. This comes in picture in case of inheritance.
Example: NokiaBasic Handset.
NokiaNSeries(Extends the features of NokiaBasic Handset features)
Overriding: comes to picture when functionality changes in the derived class. We override the functionality of a particular function in a derived class(Dynamic Polymorphism).
Example: All the functionality which NokiaBasicHandset has, are implemented in NokiaNSeries but there is a difference in the way we operate. (Picking a call, sending a message, sharing a file, etc.)