import java.util.*
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
abstract class Course(val topic: String, val price: Double) {
open fun learn() {
println("Learnign a $topic course")
}
}
interface Readable {
fun read() {
println("Reading..")
}
}
class KotlinCourse(): Course("Kotlin", 99.99), Readable {
// final: don't allow child class to override learn()
override final fun learn() {
super<Course>.learn()
super<Readable>.read()
println("I want to learn Kotlin")
}
override fun read() {
println("Leanring the kotlin")
}
}
fun main() {
val course = KotlinCourse()
course.learn()
}