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

What do you mean by collectors in java 8?

533


What are data structures in java?

525


What is hash code collision?

580


Which is easier netbeans or eclipse?

602


Does printwriter create a file?

531






Is string is a data type?

563


Can memory leak happen java?

586


Convert a BST into a DLL and DLL to BST in place.

660


Explain the difference between arraylist and linkedlist in java?

477


How can you avoid serialization in child class if the base class is implementing the serializable interface?

626


What type of language is java?

532


What is pangram in java?

505


What is super in java?

567


How are destructors defined in java?

563


Which class contains a method: cloneable or object?

530