Skip to content

Instantly share code, notes, and snippets.

@alfianyusufabdullah
Created September 19, 2021 04:37
Show Gist options
  • Save alfianyusufabdullah/017b759d5a4907c7e940ff810b1fe4ea to your computer and use it in GitHub Desktop.
Save alfianyusufabdullah/017b759d5a4907c7e940ff810b1fe4ea to your computer and use it in GitHub Desktop.
interface Payment {
val paymentName: String
}
interface Bank: Payment {
val noCard: Int
}
interface Digital: Payment {
val tagname: String
}
class Mandiri: Bank {
override val paymentName = "Mandiri"
override val noCard = 12345
}
class OVO: Digital {
override val paymentName = "OVO"
override val tagname = "@kampusmerdeka"
}
fun main() {
val ovo = OVO()
println(ovo.paymentName)
val mandiri = Mandiri()
println(mandiri.paymentName)
}
interface Payment {
val paymentName: String
val noCard: Int
}
class Mandiri: Payment {
override val paymentName = "Mandiri"
override val noCard = 12345
}
class OVO: Payment {
override val paymentName = "OVO"
override val noCard = 4312121 // no card??
}
fun main() {
val ovo = OVO()
println(ovo.paymentName)
val mandiri = Mandiri()
println(mandiri.paymentName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment