Skip to content

Instantly share code, notes, and snippets.

@renaudcerrato
Last active April 2, 2023 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save renaudcerrato/d7f23888499e6d84de1f6897d427d880 to your computer and use it in GitHub Desktop.
Save renaudcerrato/d7f23888499e6d84de1f6897d427d880 to your computer and use it in GitHub Desktop.
Kotlin Interfaces
interface A {
val a: Int // abstract
val b: Int // abstract
fun foo() // abstract
fun bar() {
// optionnal body
}
}
interface B { ... }
class C: A, B {
override val a: Int = 42
override val b: Int
get() = a + 1
override foo() { ... }
override bar() { ... }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment