Created
April 18, 2016 09:15
-
-
Save saturov/b03e653764aad7304ddaaedf50d7ce78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open class A { | |
open fun f() { print("A") } | |
fun a() { print("a") } | |
} | |
interface B { | |
fun f() { print("B") } // члены интерфейса открыты по-умолчанию | |
fun b() { print("b") } | |
} | |
class C() : A(), B { | |
// компилятор требует обязательного переопределения метода f() | |
override fun f() { | |
super<A>.f() // вызов A.f() | |
super<B>.f() // вызов B.f() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment