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
Can you please explain the difference between array_name and &array_name?
What is the difference between adt and data structure?
What is the non linear data structure?
What are the tasks performed during inorder traversal?
Why is data structure used?
What is difference between hashmap and treemap?
What is the use of data structure in real life?
What is the use of placement new?
What does quick sort do?
Is a hash table a map?
What are the types of bulleted list?
In rdbms, explain what is the efficient data structure used in the internal storage representation?
What is a weighted graph?
What does arrays tostring do?
What is the capacity of arraylist?