explain oops concepts with examples?
Answer Posted / vijay
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 buttons, we don't see the
button circuits .i.e buttons circuits 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
Polymorphism:
Sinle Form behaving differently in different
Situations.
Example:-
Person
Person in Home act is husband/son,
in Office acts Employer.
in Public Good Citizen.
| Is This Answer Correct ? | 101 Yes | 10 No |
Post New Answer View All Answers
What are the wrapped, classes?
What is class array in java?
What happens if we don’t define serial version uid?
What are different types of classloaders?
What are the methods to rectify ambiguities in the interfaces in JAVA?
Which variables are stored in heap?
What do you understand by the term wrapper classes?
What is incompatible types in java?
Can we use a default constructor of a class even if an explicit constructor is defined?
What is super keyword explain with example?
how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)
What is a 16 bit word?
Is Java a dying language?
What is the differences between heap and stack memory in java? Explain
Is set ordered?