This syntax can be shown like this:
Class super-class extends subclass1, implements subclass2, implements subclass3
Here super-class inherits properties from subclasses.
When we wish to add a single function or more to an existing class without changing the class itself, we can simple extend the class and then create our function in our new class. Let’s see an example of it.
Class human extends brain, implements eye, implements hand
Here class human has its own types and also uses types of brain, eye, and hand as required. The difference with other languages is that it uses the ‘implements’ keyword for every implementations. Other languages implements interfaces like ‘implements eye, head, brain’, uses the ‘implements’ keyword only single time.
List of my works:
- Product Based Quantity Wise Shipping: Find it here.
- OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
- Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
- Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
- Custom Field Product - add unlimited custom fields to the product form: Find it here.
- Formcaptcha - add captcha on the register page: Find it here.