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 Linked lists?
What is data and data structure?
Why is sorting important?
Give a good data structure for having n queues ( n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space.
Is json a data structure?
Why hashmap is faster than hashset?
Which process places data at the back of the queue?
in tree construction which is the suitable efficient data structure? (Array, linked list, stack, queue)
What are the advantages of merge sort?
Write a code for dynamic allocation of array.
What is stack and its operations?
Does hashmap preserve insertion order?
Explain linear linked implementation of Stack and Queue?
What is dynamic array in excel?
What is ds tree?