Tell me real world example of polymorphism and encapsulation .

Answer Posted / nagaraj

polymorphisms:-
polymorphisms is nothing but ability to take more than one forms(One Interface,Multiple Methods or One Name,Many Forms).

Encapsulation:-
-is nothing but wrapping the data and functions into single entity.

Inheritance:-
The Process of deriving new class from existing class.This is called Inheritance.
New Class-Child Class
Existing Class-Parent Class


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...

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is weight balanced tree in data structure?

468


What are the benefits of using arrays?

499


Explain what is the type of the algorithm used in solving the 8 queens problem?

463


Is array a dynamic data structure?

494


Does hashtable allow null values?

478






What is precision in data structures?

663


Explain about map and their types?

585


What are the major data structures used in the rdbms?

545


What is the default value of Array?

639


List the applications of set adt?

490


Which one is the simplest sorting in data structure?

621


What is sorting in math?

512


What is declaring array?

472


What is a dequeue?

537


Which is better array or linked list?

476