Introduction to OOP
Introduction to OOP-
Collection of interacting objects.
Usually contain different type of objects each
type corresponding to a particular kind of
Organizes a program around it’s data(object)
& a set of well defined interfaces to that data.
Describes the structure of a system in terms
of objects & relationaships.
Three basic elements of OOP-
Methods or Actions
A main identity or idea.
Independent with a distinct role or
an instance of a class.
an employee which is real world entity we
can make an object of it and then utilize it in
a program with its behaviors and actions.
All objects are distinguishable.
Methods or Actions-
Associated with the object.
Depends on application.
method is a subroutine (or procedure)
associated with a class.
At runtime, they have access to data stored
in an instance of the class.
Contain objects with similar attributes.
Define the type of their instances.
Represents a noun, such as a person, place
or thing, or something nominalized.
We can create any no. of objects belonging
to that class.
Example-Person, process ,company are
Derive from Greek language & it means
One interface ,many methods.
Ability to create a variable, a function, or an
object that has more than one form.
Example-in a method of build(),we can make
square, rectangle , circle etc..
One object require the properties of another.
Properties transferred from super class to
Support the concept of hierarchical
Sharing of operation & actions between
Binds the data & the actions in one classor
mechanism for restricting access to some of
the object’s components.
Protective text wrapper that prevents the
code & data from being accessed by other
code outside the wrapper.
ability to prevent certain aspects of a class or
software component from being accessible to
protecting other parts of the program from
extensive modification if the design decision