DIFFERENCE BETWEEN ABSTRACT CLASSES AND INTERFACE IN PHP

Jonas Stuart

Total Post:27

Points:189
Posted by  Jonas Stuart
PHP
 580  View(s)
Ratings:
Rate this:
Hi Experts

Please tell me what is a difference between Abstract classes and Interface in php i'm little bit confused between them.

Thanks
  1. Mark Devid

    Post:102

    Points:714
    Re: Difference between Abstract classes and Interface in PHP

    Abstract classes

    Classes which cannot be instantiated and require subclasses to provide implementation for the abstract methods or in other words you cannot create object of abstract classes and these classes are used for inheritance purpose. Abstract classes can only inherited in your child class.

    Interface 

    similar to abstract class. As we all know PHP does not support multiple inheritance. This problem is solved by interface in which you group classes that share some functionality that do not necessarily share a parent class.


      Modified On Jun-26-2016 10:51:59 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!