Super class is a different name for the parent class.
Inheritance is a mechanism by which one or more classes can be derived from a base class.
The point of using an interface has to do with code organization for me, than enforcement by the language itself. I use them a lot when preparing code for other developers to work with so that they stay within the intended design patterns. Interfaces are a kind of “design by contract” whereby your code is agreeing to respond to a prescribed set of API calls that may be coming from code you do not have access to.
- All methods in the interface must be implemented within a class; failure to do so will result in a fatal error. Classes may implement more than one interface if desired by separating each interface with a comma.
- Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled
- Interfaces are defined using the interface keyword, in the same way as a standard class, but without any of the methods having their contents defined.
- All methods declared in an interface must be public; this is the nature of an interface.
- Interfaces allow you to create code which defines the methods of classes that implement it. You cannot however add any code to those methods.
- To implement an interface, the implements operator is used.
- It’s possible for interfaces to have constants. Interface constants works exactly like class constants except they cannot be overridden by a class/interface that inherits them.
Encapsulation is the packing of data and functions into a single component. The features of encapsulation are supported using classes in most object-oriented programming languages, although other alternatives also exist.
An interface acts like a template that can only define functionality, never implement it. It contain properties and method declarations but not method bodies.
Constants are variables that should not be changed.
Static method is a method that can be accessed without initiating the class. For example: classname::staticmethod();
Boolean, string, integer, array, object, null, resource, double.
$this is a pseudo variable by which a class can refer to an object instance.
A constructor method is invoked when an object is created. It is used to set things up.