abstract class IntQueue { def get(): Int def put(x: Int) } trait Doubling extends IntQueue { abstract override def put(x: Int) { super.put(2 * x) } } class Animal trait Furry extends Animal trait HasLegs extends Animal trait FourLegged extends HasLegs class Cat extends Animal with Furry with FourLegged