abstract class Teacher{ def teach:Unit } trait ChinsesTeacher extends Teacher{ def teach: Unit = println("teach Chinese") } trait EnglishTeacher extends Teacher{ def teach: Unit = println("teach English") }
def main(args: Array[String]): Unit = {
val teacher=new Teacher with ChinsesTeacher with EnglishTeacher
teacher.teach
}