Kotlin Basics - Companion Object
fun main(){
println(Car.getInfo())
}
class Car(){
companion object{
fun getInfo() : String {
return "Mahindra XUV 300"
}
}
}
As observed from the above example,
Members of companion object can be called si...
vigneshprabhu.dev1 min read