OOP’S Real Time Example :-

Polymorphism Real Time Examples :-

Poly = many

morphs = forms

existing in many forms.

It is achieved by OVERLOADING and OVERRIDING.

EXAMPLE: We behave diffrently in front of elders, and friends.

a single person is behaving diffrently at diffrent time.

Eg: A Person who knows more than two languages he can speak in a language which he knows. Here person is Object and speak is polymorphisam.

Eg: girl like a friend,girlfiriend,daughter

__POLYMORPHISAM MEANS HAVE SAME FORMS WITH DIFFERENT METHODS

EXAMPLE MAN EAT FOOD, MAN DRINK WATER.

HERE MAN IS THE FORM HAVING WITH SAME NAME

FOOD AND WATER IS THE METHODS__

Inheritance:-

A secintific calculator is a extend form of Caluculator here Caluculator is parent and secintific calculator is Child object.

Encapsulation:

Encapsulation is like your bag in which you can keep your pen, book etc. It means this is the property of encapsulating members and functions.

You have a Mobile Phone, you can dial a number using keypad buttons. Even you don't know how these are working internally. This is called Abstraction. You have the only information that is needed to dial a number. But not its internal working of mobile.

But how the Mobile Phone internally working?, how keypad buttons are connected with internal circuit? is called Encapsulation.

results matching ""

    No results matching ""