Created
September 19, 2021 04:37
-
-
Save alfianyusufabdullah/017b759d5a4907c7e940ff810b1fe4ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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) | |
} |
This file contains hidden or 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
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