![]() |
#1 |
Registered User
Join Date: Jun 2018
Posts: 60
|
What are Traits?
What are Traits?
|
![]() |
![]() |
![]() |
#2 |
Registered User
Join Date: Jan 2016
Location: Romania
Posts: 28
|
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. |
![]() |
![]() |
![]() |
#3 |
Registered User
Join Date: Aug 2017
Location: New Delhi
Posts: 76
|
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.
__________________
digital marketing consultant in India | digital marketing consultant in Delhi | Video Marketing Company |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|