Skip to content

Instantly share code, notes, and snippets.

@saturov
Created April 18, 2016 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saturov/b03e653764aad7304ddaaedf50d7ce78 to your computer and use it in GitHub Desktop.
Save saturov/b03e653764aad7304ddaaedf50d7ce78 to your computer and use it in GitHub Desktop.
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