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 do you mean by balance factor of a node in avl tree?
State the different ways of representing expressions?
Differentiate between compilers and interpreters.
What exactly is a thread?
How would you reverse characters of an array without using indexing in the array.
What is push and pop in stack?
Which sorting is best and why?
What does a bubble chart show?
State the difference between persistent and ephemeral data structure?
What is a spanning tree?does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?
How to cut or remove an element from the array?
Define indegree of a graph?
What is the easiest sorting method to use in data structures?
What stack means?
What are the types of map?