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
Can we override final method?
Is it possible to override the main method?
What is final?
What is a singleton in genetics?
What happens if we don’t define serial version uid?
What are the different types of sorting in java?
How thread scheduler schedule the task?
What is java’s garbage collected heap?
What is the point of polymorphism java?
Variables used in a switch statement can be used with which datatypes?
What does exp mean in math?
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
What is final class?
What is the use of static class?
What is bufferedwriter?