what are the oops concept in java explain with real time
examples
Answers were Sorted based on User's Feedback
Answer / chandramouli
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:TV Remote Button
in that number format and power buttons and other buttons
there.just we are seeing the butttons,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:Medical Capsuals
i.e one drug is stored in buttom layer and another drug is
stored in Upper layer these two layers are combined in
single capsual.
Inheritance:
The New Class is Existing from Old Class,i.e SubClass is
Existing from Super Class.
Real Time Example:
Father and Son Relationship
Polymorphisam:
Sinle Form behaving diffreantly in diffreant
Situations.
Example:-
Person
Person in Home act is husband/son,
in Office acts Employer.
in Public Good Cityzen.
I think these all are real time experianceany.is there any
more answers send me my mail also.
Thanks all
CM
Is This Answer Correct ? | 1225 Yes | 68 No |
Answer / raja
Encapsulation
Abstraction
polymorphisms
inheritance/delegation
Is This Answer Correct ? | 588 Yes | 111 No |
Answer / ramya
1)Abstraction:
Abstraction is a way to remove the association of the
behavior of an object with the actual details behind the
scenes which implement that object's behavior. This
'abstraction' is usually accomplished through the use of
base classes with virtual functions; each derived function
provides the details that implement the behavior behind that
abstraction.
eg/we invented flight based on the mechanism of Birds. So
flight is derived form the base of birds.
2)Encapsulation:
It is a process of binding or wrapping the data and the
codes that operates on the data into a single entity. This
keeps the data safe from outside interface and misuse. One
way to think about encapsulation is as a protective wrapper
that prevents code and data from being arbitrarily accessed
by other code defined outside the wrapper.
eg/ Ink is the important component in pen but it is hiding
by some other material
3)Polymorphism:
a single function or single operator has different character
in different place.
eg/A girl plays a role of daughter at home and a manager at
office
4)Inheritance:
The new classes, known as derived classes, take over (or
inherit) attribute and behavior of the pre-existing classes,
which are referred to as base classes (or Parent classes).
It is intended to help reuse existing code with little or no
modification.
eg/ parent-child relation
Is This Answer Correct ? | 190 Yes | 63 No |
Answer / devendra.m
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:TV Remote Button
in that number format and power buttons and other buttons
there.just we are seeing the butttons,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:Medical Capsuals
i.e one drug is stored in buttom layer and another drug is
stored in Upper layer these two layers are combined in
single capsual.
Inheritance:
The New Class is Existing from Old Class,i.e SubClass is
Existing from Super Class.
Real Time Example:
Father and Son Relationship
Polymorphisam:
Sinle Form behaving diffreantly in diffreant
Situations.
Example:-
Person
Person in Home act is husband/son,
in Office acts Employer.
in Public Good Cityzen.
I think these all are real time experianceany.is there any
more answers send me my mail mdevendra@gmail.com also.
Thanks all
Devendra.M
Is This Answer Correct ? | 131 Yes | 28 No |
Answer / murali krishna thanneeru
We have the following oops concepts like
1.Abtsrction
2.Encapsulation
3.Inheritance
4.Polymorphism
Abstraction:
hiding unnecessary data from the users and making the
application as user friendly then it is called as abstrcation
ex:Any mail account the user is simply filling the form and
he don't know ho it is developed.
Encapsulation:
Wrapping the data and code as a single unit is called as
encapsulation.
ex:Capsule is the best real time example for it.In it we
will have two types of drugs combined as single capsule.
Inheritance :
Acquiring the properties from one class(base class or parent
class)to another class(derived class or child class)is
called as inheritance.
Ex:Inventing laptop from desktop.
Polymorphism:
Single entity behaving in different forms is called as
polymorphism
ex:Mouse is for click the buttons and dragging the bars or
placing the pointer in a particular place.
Is This Answer Correct ? | 69 Yes | 14 No |
Answer / praveena
OOPS Concepts are mainly 4
1.Abstraction
2.Encapsulation
3.Inheritance
4.Polymorphisam
Abstraction:Hiding unneccessary data from user is called
Abstraction access specifiers like public,private etc are
used to provide different level in abstraction.
Encapsulation:Taking data and object in a single unity is
called Encapsulation.A class is example for Encapsulation.
Inheritance:creating anew class from existing class is
called Inheritance.reusability is main advantage in
inheritance.
polymorphism:if single mthod performs different task is
called polymorphism.
Is This Answer Correct ? | 89 Yes | 35 No |
Answer / l.priya
We have the following oops concepts like
1.Abtsrction
2.Encapsulation
3.Inheritance
4.Polymorphism
Abstraction:
hiding unnecessary data from the users and making the
application as user friendly then it is called as
abstrcation
ex:Any mail account the user is simply filling the form and
he don't know ho it is developed.
Encapsulation:
Wrapping the data and code as a single unit is called as
encapsulation.
ex:Capsule is the best real time example for it.In it we
will have two types of drugs combined as single capsule.
Inheritance :
Acquiring the properties from one class(base class or parent
class)to another class(derived class or child class)is
called as inheritance.
Ex:Inventing laptop from desktop.
Polymorphism:
Single entity behaving in different forms is called as
polymorphism
ex:Mouse is for click the buttons and dragging the bars or
placing the pointer in a particular place.
Is This Answer Correct ? | 57 Yes | 12 No |
Answer / niventh mca
1,class
2,encapsulation
3,polymorphism
4,inheritance
5,Abstraction
class
collection of attributes is called class
Real time example......human body
encapsulation
To encapsulate the some methods,operations in one
class is called the encapsulation
Real time example...... capsules
polymorphism
To ability to take more than one form
Real time example...... xerox machine
inheritance
one class properties occur from another class properties
Real time example......land line...will phone....cellphone
2g....3g....
Is This Answer Correct ? | 76 Yes | 34 No |
Answer / bhaskara reddy akepati
Abstraction:
Hiding unnecessary things and showing the essential
information.
Example: Suppose take a car: In that we will have breaks
and stering and etc... Here when we are changing the gear
box to up or bottom then gears will work but we don't know
how they are managing internally and we don't no how it is
working. As a driver we don't need to know how it is
working internally when we are changing every time. That is
the reason they will hide the wires and cables internally
and they will show up only gear box to us.
Advantages: 1) Code will be clean and for managing it will
be very easy
Inheritance:
Acquiring the properties from super class to
subclass.
Example: Suppose take two java classes
Class A contains 2 variables and ClassB Extends Class A
that means here ClassB can access the classA variables
without declaring it. If we do this then the memory will be
less and reusable.
Advantages: 1)Reusability of code
Encapsulation: Wrapping up of data and methods into a
single unit.
Example: In our class we need to make all our varables and
methods keeping together.
Advantage: Maintance will be good
Polymorphism: It means many forms.
2 types:
1) Compile time polymorphism
2) Run time polymorphism
Method overloading is an example for Compile time
polymorphism and
Method overriding is an example for Run time polymorphism
Is This Answer Correct ? | 24 Yes | 7 No |
Answer / m arunachalam
OOPS COncepts Are:
Mainly these are the concepts are very important in oops:
Abstraction
Encapsulation
Inheritance
Polymorphism.
Birds Vs Abstractions
Birds: we invented flight based on the mechanism of Birds.
So flight is derived form the base of birds.
Abstraction: Abstraction is a way to remove the association
of the behavior of an object with the actual details behind
the scenes which implement that object's behavior. This
'abstraction' is usually accomplished through the use of
base classes with virtual functions; each derived function
provides the details that implement the behavior behind that
abstraction.
Pen Vs Encapsulation
Pen: Ink is the important component in pen but it is hiding
by some other material
Encapsulation: is a process of binding or wrapping the data
and the codes that operates on the data into a single
entity. This keeps the data safe from outside interface and
misuse. One way to think about encapsulation is as a
protective wrapper that prevents code and data from being
arbitrarily accessed by other code defined outside the wrapper.
Crocodile Vs Polymorphism
Crocodile: live indifferently on land or in the water. In
water it’s Moment very fast compare to land. An animal lives
in different character in different place.
Polymorphism: a single function or single operator has
different character in different place.
Inheritance Vs Human Relationship
Human Relationship: GrandFather-Father-Son
Inheritance:A derived from existing one to new one is known
as Inheritance.
Is This Answer Correct ? | 12 Yes | 2 No |
Explain the difference between Unicast and Multicast objects?
What is a flag and how does it work?
Write a program in java to create a doubly linked list containing n nodes.
Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situations (in general) would you use a HashSet to store a collection of values?
What all methods are used to prevent thread execution ?
different types of threads?
Difference between canvas class & graphics class?
What do you mean by platform independence of Java?
What is nan in java?
What is complexity in java?
How do I remove a character from a string in java?
Difference between String & StringBuffer
16 Answers IBM, Infosys, Tech Mahindra, Wipro,