InterviewSolution
Saved Bookmarks
| 1. |
What are traits? How is it used in PHP? |
|
Answer» A trait is a group of various methods that reuse in SINGLE inheritance. A Trait is intended to REDUCE some LIMITATIONS of single inheritance by enabling a developer to reuse sets of processes. We can combine traits and classes to reduce complexity, avoid PROBLEMS typically associated with Mixins and multiple inheritances. Related Article: How to USE Traits in PHPExampletrait HelloWorld |
|