Sunday, November 25, 2012

Object Oriented Programming

PHP is an object- oriented programming language.

What is object-oriented programming (OOP)?

Object-oriented programming(OOP) is a programming language using objects usually instances of a class, consisting of data fields and methods together with their interactions to design applications and computer programs.

Main features of OOP are as below:

 Class and object:
    A class is a group of objects and an object is an instance of a class. It contains the code for properties and methods.


Encapsulation:
    Encapsulation is the ability of an object to protect the data (properties) of a class from outside influences. You can use a class (its properties) through an object instance, without having access to its code.

Inheritance:
    Inheritance is the ability of a class to copy or inherit the properties and methods of a parent class.

Polymorphism:
    Polymorphism is a class ability to do more different things, or use one class or another to achieve the same thing, having similar functions.

No comments:

Post a Comment