+59

Some real life Examples of Object-oriented programming (OOP) concept.

1 .Polymorphism : The process of representing one form in multiple forms is known as Polymorphism. Example - Suppose if you are in class room that time you behave like a student, when you are in market at that time you behave like a customer, when you at your home at that time you behave like a son or daughter, Here one person present in different-different behaviors. 2. Abstraction : Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context. Examples - Abstraction shows only important things to the user and hides the internal details, for example, when we ride a bike, we only know about how to ride bikes but can not know about how it work? And also we do not know the internal functionality of a bike. Abstraction is ATM Machine; All are performing operations on the ATM machine like cash withdrawal, money transfer, retrieve mini-statement…etc. but we can't know internal details about ATM. 3. Encapsulation = Data Hiding + Abstraction. Example - Looking at the example of a power steering mechanism of a car. Power steering of a car is a complex system, which internally have lots of components tightly coupled together, they work synchronously to turn the car in the desired direction. It even controls the power delivered by the engine to the steering wheel. But to the external world there is only one interface is available and rest of the complexity is hidden. Moreover, the steering unit in itself is complete and independent. It does not affect the functioning of any other mechanism. 4. Inheritance - Example - Father gives his property to child , father got that properties from child’s grandfather , so child is the taker and father is giver , hence father works as a base class and child as derived class , • you can explain is that the child couldn’t give its property to father so Inheritance is one sided • why it is needed? so you can explain like same properties needed in multiple class you need not to write multiple times

3/10/2017 7:43:37 AM

Rashmi Ranjan Bisoi

24 Answers

New Answer

+17

Thanks for these great explanations! :)

+5

Ok so now I have take time to read :) I feel programming should be teach that way and everyone in the world could develop an OS :D Great post, thanx!

+3

12 polymorphism Process of representing one form in many ways. Example Your behavior that is, u behave differently with different person in different place I mean, to parents I'll be good son, and to a friend u r a buddy and u share things with him /her and to teachers u show some respect . Here it behavior is goes on changing with people u meet. 2:abstraction Process of showing essential information to user and hide the rest Example : Think u have a car, and u are riding car now, when u apply break u know that car gone a stop but u don't know what is the process happened when u applied break

+3

This is useful for me, thanks.

+3

Really great analogy mate, first time I get a bit of insight into OOP

+2

Thanks Rashmi for such a wonderful explanation I need to know how we use this concept in programming. There is interface,abstract class, static class and final class. Many people do not know how to use this concept and why? What are advantages and how this concept make our life happy in programming I hope you understand my doubt regarding prove concept by practically rather than theortical

+2

+2

Thanks for such explanations!!

+2

Thanks for sharing it. I'm new to programming n it helped me to understand better about it.

+2

Love that, I will take time to read it :)

+1

now , some rich people have self driving cars and the cars are mainly built in google.

+1

Nice examples. new in programming and I have a problem connecting it to real world

+1

polymorphism,abstraction Encapsulation and the most important inheritance

+1

anyone with a good book or materials especially on android development should please mail me. mossyadex@gmail.com

+1

really nice!

+1

thinks

+1

thinks

0

0

哈哈哈哈哈哈哈,真棒

0

bxn