Email us at info@henrytech.org to discuss your Drupal Migration today!
Abstract classes may have implemented methods, whereas interfaces have no implementation in themselves.
One can implement multiple interfaces, but not extend multiple classes (or abstract classes).
An abstract class implements an interface, which defines things that your objects needs to implement. An abstract class is a like a “default” class that should be able to be easily extended by static classes that are specific to objects.
Function Types:
public is available everywhere protected is available only in that class or in extended sublcasses private is only available in that class
An abstract class is intended to be used as a base of a class inheritance hierarchy. A static class cannot be the base of a class inheritance hierarchy. A static class is intended for singleton state or stateless functionality.
You cannot instantiate a static class, because it is meant to create data and functions without creating an instance of the class.
Comments