The `trait` keyword is used to define a set of methods and fields that can be mixed into classes. It provides a way to achieve multiple inheritance.