Follow by Email

Tuesday, 19 June 2012

Real life examples of polymorphisms, encapsulation and inheritance?

Polymorphism:

say a door..
a door to a temple, a door to a house, a door to a kitty house,
all are doors, but all look different

Encapsultion:

cars and owners...
all the functions of cars are encapsulated with the owners..
No one else can access it...


Inheritence:

Kingfisher jet
^
|
Airplane
^
|
Flying Things

0 comments:

Post a Comment


                                                            

 
Design by Abhinav Ranjan Sinha