what are the oops concept in java explain with real time
examples

Answer Posted / shakti mishra

ABSTRACTION
ENCAPSULATION
POLYMORPHISM
INHERITANCE
these 4 are the OOPS concept in java.
ABSTRACTION:means hiding the irrelevant information from the
user.
EXAMPLE:a user of mobile phone in not interested with the
circuitry involved it is irrelevant to the user of mobile
but he is only interested to know how to call a person,how
to send the message etc.thus the circuitry is hided from
the user.
ENCAPSULATION:means wrapping of data and method into a
single unit so that no one can misuse it and safe the date
from outside interface.
EX;MEDICAL CAPSULE
means the medicine is wall encapsulated with the outside
layer so that no one can it keeps the medicine safe from the
outer interface.
INHERITANCE:means object of a class acquire the property of
the object of another class.it provide reusability means if
we want to add more feature then instead of modifying the
class we have just to extend the class into subclass.
EXAMPLE:suppose a bird robin belongs to the class of flying
bird but flying bird also belong to the class bird.
so bird robin inherit the property of both.
POLYMORPHISM :means taking more than one form
EXAMPLE:Person in Home act is husband/son,
in Office acts Employer.
in Public Good Citizen.
hopefully i m able to solve your problem.THANX

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does substring start with 0?

547


What is the final variable?

572


Is main a keyword in java?

530


What do you mean by compiler?

571


How do you write methodology?

554






Differentiate between overriding and overloading cases?

586


what is the difference between process and thread? : Java thread

555


State some advantages of java?

703


What is off heap memory?

540


What are the types of collections in java?

531


What are triggers in DB? Explain their types. How do they work?

615


which pattern is default in scanner package?

1791


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2362


What is the transient keyword?

620


What is locale in java?

567