📅  最后修改于: 2022-03-11 14:53:32.485000             🧑  作者: Mango
fun main() {
Child().hairColour() /// brown
Child().eyeColour() /// blue
}
interface Parent {
val eyeColour: String
get() = "blue"
val hairColour: String
get() = "black"
fun eyeColour() {
println(eyeColour)
}
fun hairColour() {
println(hairColour)
}
}
class Child : Parent {
override val hairColour = "brown"
}