Hi,
Traits are basically Scala's workaround for the JVM not supporting multiple class inheritance.
Here is an example of traits in Scala:
trait Car {
val brand: String
}
trait Costly{
val cost: Int
}
trait Milege{
val milege: Int
}
class Audi extends Car with Shiny with Miles{
val brand = "Audi"
val cost = 140000
val milege = 20
}
I hope it helps.