define oops concept with example



define oops concept with example..

Answer / lata bheemanagar bp

Hi Friends, Good Evening!!
We write Object Oriented Programs.
now, What is Object? --->It is a Real World Entity.
Say for Example:BOX
I want to write a program on this real world entity.It does not mean that i will insert this BOX inside the CPU and write some LOGIC.
I take the properties of this BOX like Height,Width,& Diagonal etc...embed them in a class.and create 'N' number of Objects of this class with different sizes.
This is how we can relate the real world entities in OOPs.
There are mainly 4-types
1) Abstraction---> Hiding complex implementations from users & providing required functionalities to users.
Exp: Birds
We invented 'FLIGTHS' based on the mechanism of Birds,so flight is derived from the base of 'BIRDS'.

2)Inheritence.--->Aquiring properties from one class to another class.
Exp: Human Heridity
aquiring properties from one person to another.

3)Encapsulation->Technique of making fields Private & Providing a Public method to access Private field.
Exp: Pen
In Pen INK is the important thing but it is hiding by some material.

4)Polymorphism->(Many Forms):One Object can take different forms in different situations.
Exp: Crocodile
Crocodile live in differently in Land & in Water.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What causes polymorphism?

0 Answers  


c++ is a pure object oriented programming or not?

5 Answers   Wipro,


what is the sylabus for priliminaries?

0 Answers  


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

0 Answers  


What is a template?

7 Answers  


what is polymorphism?

4 Answers  


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

0 Answers  


Difference ways of Polymorphism?

3 Answers  


What is interface? When and where is it used?

0 Answers  


What are the advantages of polymorphism?

0 Answers  


Is data hiding and abstraction same?

0 Answers  


Can private class be inherited?

0 Answers  


Categories