Skip to content

Commit

Permalink
Update Override in kotlin.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
2030481 authored Sep 19, 2022
1 parent abaca3e commit 25bc836
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Override in kotlin.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
/*
*
*/
open class ABC {
open val count: Int = 0

open fun think () {
println("Hey!! i am thinking ")
}
}
class BCD: ABC() {
override val count: Int

init{
count = 100
}

override fun think() {
println("I am from Child")
}

fun displayCount(){
println("Count value is $count")
}
}
fun main(args: Array<String>) {
var a = BCD()
a.displayCount()
}

0 comments on commit 25bc836

Please sign in to comment.