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
What is difference between static and dynamic array?
What is an acyclic graph?
What is the idea behind splaying?
State the different ways of representing expressions?
what is a balanced tree.
Can a null element added to a treeset or hashset?
What do you mean by an Array?
What is the difference between array and stack?
How can we remove loops in a linked list? What are the functions of fast and slow pointers?
How to do the intersection of two sorted arrays?
Given an unsorted linked list, and without using a temporary buffer, write a method that will delete any duplicates from the linked list?
Which interfaces are implemented by abstractqueue?
write a program to show the insertion and deletion of an element in an array using the position
Is null a binary search tree?
What is a matrix?