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 |
Explain the concept of abstracion and encapsulation with one example. What is the difference between them?
create a class complex having real and imaginary part of a complex no. as a data member. overload the binary operators(+,- and *) to perform the operations on complex no. objects. overload binary operator using friend function.
2 Answers CTS, Delhi University,
what is data abstraction with example.
What is the main difference between C++ and Java
WILL I GET A guaranteed JOB AFTER DOING bsc()IT) and GNIIT from an NIIT CENTRE??
21 Answers Biocon, MIT, NIIT,
Write a c++ program to display pass and fail for three student using static member function
What are the important components of cohesion?
What are properties in oop?
What is multidimensional array?
advantage and disadvantage in c++>>oops and what are the questions ask for interview in c++>>oops. could you tell me or reply me
What is polymorphism explain its types?
what about you? wahat is your object? introduce your self?
1 Answers Ajmal Perfumes, TCS,