Kotlin学习:Kotlin接口Kotlin 接口
Kotlin 接口Kotlin 接口与 Java 8 类似,使用 interface 关键字定义接口,允许方法有默认实现interface MyInterface { fun bar() // 未实现 fun foo() { //已实现 // 可选的方法体 println("foo") }}实现接口一个类或者对象可以实现一个或多个接口class Child : MyInterface { override fun ba