trait
USTRAYT/tɹeɪt/
Pluraltraits
- 1A special quality or habit that makes a person or thing easy to recognize.
Like the color of a dog's fur: a feature that helps you tell one apart from another.
Kindness is a trait that everyone admires.
Her best traits are patience and honesty.
Similarcharacteristic
Note
- 2A set of ready-made methods that can be added to a class to give it extra abilities.
Like a set of tools you can attach to different machines to give them the same skill.
A trait lets you reuse code without copying it into every class.
The programmer moved the shared methods into a trait.
Note
Practice
Can you tell the meanings of trait apart? Answer 4 quick questions from this page, or write your own sentence and AI will check it.
Origin
It comes from Middle French trait, meaning "line" or "feature," which came from the Latin word tractus, meaning "drawing" or "pulling."