In computer programming, a trait is a language concept that represents a set of methods that can be used to extend the functionality of a class.