Basic Concept’s of Object Oriented Programming

https://www.computersprofessor.com/2016/06/basic-concepts-of-object-oriented.html
Basic concept’s
of Object Oriented Programming :
Object:-
Objects are basic
run time entities in an
object oriented system.
They represent the person, place, table of data, bank account (or) any them, that
the program can
handle.They also
represent user defined
data types .
When a
program is executed, the objects interact by sending message’s to one another.Each object
contains data and
code to manipulate
the data. Objects can
interact without having
to know details
of each other
data and code.
It is
sufficient to know the
type of message
accepted and the
type of response.
Returned by the
object.
For eg:- Account
and customer for
two objects in a
program then, the customer object
may sent a message
to the account object
requesting for the bank
balance.
|
Class:
The object
contains data and code to
manipulate the data. The
entire set of
data and code
of an object
can be made
by user defined data
type with the
help of the class.
That is
the objects are
variables of the type
class.Once the
class are defined
we can create
any number of
objects belonging to
that class.
Each
object in associated
with the type data
of type class with which
they are created. Class is
a collection of
object of similar types.
Ex: mango, banana and orange
are the objects
of class fruit.
Class are
user defined data types
and they behavior
like they buds in data
type’s of programming language.
The
syntax used to
create an object
is similar to
create an integer
variable in c- language. If
fruit has been
defined as a
class then the statement.
Fruit
mango.
Will create
an object mango
belonging to the class
fruit.
|
Data abstraction
and Encapsulation:
|
The wrapping
of data and
functions as a
single unit is
known as encapsulation.Data Encapsulation is most
important future of a
class.
The data
is not accessible to the
outside words
only those functions
which are wrapped in to the
class can access
the data.
Hence, functions provide
an inter phase between
the objects, data and
program.
This insulation
of the data
from direct access by the
program are called data
hiding (or) information hiding.
Hiding the
unnecessary data from the user called
data abstraction. Abstraction
refer ‘s to the act of representing essential
features with out including
the background details(or)
explanation
Class
use the concept of
abstraction of defined
as a list
of abstract attitudes
such as size, cost , weight, etc.
The functions
that operate on this
data are called members (or) member
function.
This the
class use the
concept of data abstraction are known
as abstract data types.
Inheritance :-
It
is the process
by which object of one
class the properties of object of another
class. Inheritance support
the concept of hierarchical classification.
The principle
beyond this is
each derived class Show’s the
common characteristics with
the class from
which it is
derived.
In
object oriented programming the concept of inheritance
provide the idea of
reuse-ability.That is we
can had additional
features to an
existing class without modifying it.
This
is possible by derives new class
by existing class.There fore the
new class will have
combined feature’s of both class.
|
|
Polymorphism :
polymorphism is another important object oriented programming concept. polymorphism means the
ability to take
more than one form.
for example The operation exhibit
different behavior in different instances.The behavior depends
up on type of data
used in the
operation.
The process of
makes an operation to exhibit
behaviors on different
stages is known as
polymorphism.
The
single function can be
used to handle
number of different types
of a arguments It uses a
single function name
to perform different
types of tasks
is known as function over loading.
Dynamic Binding :-
Binding refer’s to the
linking of the procedure
call to the code to be
executed in response to
call. Dynamic binding
is also known
as late binding.
Dynamic binding means
the code associated
with the procedure
call is not known
until the time of
call at run time.
This feature
is associated with polymorphism and inheritance.
Message passing:
An object oriented program consists the
set of objects
that communicate with each other.
The process
of programming in
object oriented language
involves three basic steps.
Creating class
that defined objects
and their behavior.
Creating objects
from class definitions.
Establishing communications among
objects.
Objects communicate with
one another by sending and receiving information much the same way as people pass messages to one another,.
A message
for an object is
request for execution of a procedure and there fore will invoke a method in the receiving object
that generates the desired result.
message passing involves
specifying the name of the object, the name of the method and the
information to be send.
|