What are Traits?
What are Traits?
|
Hi there,
Traits are similar to classes, but they cannot be instantiated, therefore they do not contain a constructor. You can group a set of methods in a trait, that will be reused with future classes you will have. However, i'm sure you are familiar now with them, i see the post is 6mo old. |
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.
|
All times are GMT -7. The time now is 09:48 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.