Answers for "how to use variables from parent class in kotlin"

1

how to use variables from parent class in kotlin

//add open to the inheirted variable
open class A{
	open var x=5
}
class B:A(){
	override var x=2*super.x
}
Posted by: Guest on April-22-2022

Code answers related to "how to use variables from parent class in kotlin"

Browse Popular Code Answers by Language