what are the oops concept in java explain with real time
examples

Answer Posted / ajay kumar agarwal

OOPS Concepts are mainly 4
1.Abstraction
2.Encapsulation
3.Inheritance
4.Polymorphisam
Abstraction:-Hidding non-essential features and showing the
essential features

(or)
Hidding unnecessary data from the users details,is called
abstraction.
Real Time example:Any electronic Device

in that we don't see the
button circuits.i.e buttons circutes and wirings all are
hidden.so i think its good example.

Encapsulation:

Writing Operations and methods stored in a single
class.This is Called Encapsulation

Real Time Example:A state Or Country
i.e different culture districts make a state.and different
behaviours of states form a country..
I think it is good example

Inheritance:
The New Class is Existing from Old Class,i.e SubClass is
Existing from Super Class.

Real Time Example:

Father and Son Relationship is the Ever green example

Polymorphisam:

Sinle Form behaving diffreantly in diffreant
Situations.
Example:-
Camera Mobile
when we talk used as communicator,
When we go for a tour used as a camera.
When we want to enjoy used as a player or FM.

I think these all are real time experianceany.is there any
more answers send me my mail Madhu.jjj@rediffmail.com also.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what r advatages of websphere? & how to deploy?

1623


Tell us something about an iterator.

540


How do generics work in java?

506


Mention the default values of all the elements of an array defined as an instance variable.

506


What is a Null object?

876






Which are different kinds of source code?

645


What is data type in computer?

513


Explain about static imports in java?

582


What is initial size of arraylist in java?

524


How do you convert string to int in java?

546


Program to Find the second largest element in an array.

574


What is not thread safe?

480


How do you sort a list in java?

563


What is a condition in programming?

542


Why is the singleton pattern considered to be an anti pattern?

460