标签:zha reading pre with read array str listening pack
package com.bjsxt.scala trait Read{ def read(name:String)={ println(name+ " is reading...") } } trait Listen{ def listen(name:String)={ println(name+ " is listening...") } } class Person1() extends Read with Listen{ } object Lesson_Trait { def main(args: Array[String]): Unit = { val person = new Person1() person.read("zhangsan") person.listen("lisi") } }
标签:zha reading pre with read array str listening pack
原文地址:https://www.cnblogs.com/huiandong/p/9278281.html