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
Explain what are the notations used in evaluation of arithmetic expressions using prefix and postfix forms?
How do you assign an address to an element of a pointer array ?
Define an algorithm. What are the types of algorithms?
What is complete binary tree and almost complete binary tree?
Explain about circular linked list?
Does concurrenthashmap allow null?
Can you provide some implementation of a dictionary having large number of words?
Why quicksort is faster than merge sort?
Is arraylist fail fast?
What is bubble insertion selection sort?
What is the difference between ienumerable and list?
What do you mean by secondary clustering?
What is the difference between 1d and 2d array?
Define red-black trees.
what are the applications that use Linked lists?