OOPs concept forms the basis of Java
Programming Language, I will try to answer
your question in a very layman language.
OOPs stands for Object
Oriented Programming. An approach to do
programming which is based on Objects (or
real life objects).
There are mainly six OOPs concepts in
What is an object? Let me explain you this
with a very simple example.
Consider a phone, now remember that an
object always consists of behavior and
state. In our current example a mobile can
have behaviors i.e. It can make & receive
calls, It can receive messages , It can set
alarms etc. while it can have states too i.e. it
will have model number, color, type etc. Best
core java training in Bangalore
Class is a logical collection of
the objects and nothing more than
Moving on with our current example if
an object is a phone than the
collections of different types of phones
is known as a class or if you consider
vehicle as a class then collection of all
types of vehicle i.e. car, bike, truck,
ambulance, scooter etc.
can considered as objects of this class.
Similarly think of other examples of your own.
Inheritance is a special type
of relationship where a class acquires the
inherent properties of its parent class
along with this it also contains its own
For eg. Consider there is a Phone
class which is a parent class ,now phone
class can contain very basic properties
that a other types of phone class should
possess i.e. make and receive calls and
redial properties. As shown in the above
diagram there are three child classes of
the phone class
Telephone contains the properties of
parent class and it does not have it own
Mobile phone inherits the properties of
parent class as well as its own exclusive
properties like send and receive messages.
Smart phone inherits the properties of
parent class along with this it also contains
its own pro