Follow Me:

Monday, 6 July 2015

Abstract class in PHP:


  •     Abstract Class  contains only declare the method's signature, they can't define the implementation.
    •     Abstraction class are defined using the keyword abstract .
    •     Abstract Class is not possible to implement multiple inheritance.
    •     Latest version of PHP 5 has introduces abstract classes and methods.
    •     Classes defined as abstract , we are unable to create the object ( may not instantiated ).


    •     we can extend the Abstract class, by using extends operator.
    •     we can inherit only one abstract class at one time extending.
    •     Any class that contains one abstract method must also be declare as abstract.
    •     All methods marked as abstract in the parent's class, declaration must be defined by the   child.
    •     Additionally, these methods must be defined with the same (or a less restricted) visibility           (Public,Protected & private).
    •     Type hint & number of parameter must be match between parent & child class.

      Related Posts:


    Categories:

    3 comments:

    1. This comment has been removed by a blog administrator.

      ReplyDelete
    2. This comment has been removed by a blog administrator.

      ReplyDelete

    3. Thanks for posting this useful content, Good to know about new things here, Let me share this, . Hadoop training in pune

      ReplyDelete