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
What is the meaning of immutable regarding string?
What is a treeset in java?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
Why does abstract class have constructor?
What will happen if a thrown exception is not handled?
Can a abstract class be defined without any abstract methods?
Explain the transient field modifier?
If try block is successfully executed, Then Is Finally block executed?
What is the technique adopted to create an immutable class?
What is garbage collector?
How do you declare a destructor in java?
What do you understand by weak reference?
What does @param args mean in java?
What is an immutable class? How to create an immutable class?
How many arguments can a method have java?