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


Please Help Members By Posting Answers For Below Questions

Can we override final method?

571


Is it possible to override the main method?

537


What is final?

611


What is a singleton in genetics?

572


What happens if we don’t define serial version uid?

572






What are the different types of sorting in java?

542


How thread scheduler schedule the task?

587


What is java’s garbage collected heap?

542


What is the point of polymorphism java?

551


Variables used in a switch statement can be used with which datatypes?

525


What does exp mean in math?

539


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

2138


What is final class?

579


What is the use of static class?

551


What is bufferedwriter?

542