Take a look at this code – “` open class Person ( var name:String, var age:Int ) { // some code }
class Employee(company: String) : Person(/pass string and int here/) { } “` While calling, I’ll have to pass name and age args, right? But I want that from the user, not me… for eg.
class Employee(company: String) : Person(“Chris”, 29) { } //not my intention
I want this
class Employee(company: String) : Person(somename, someage) { }
But obviously I’ll get an unresolved refernce somename, someage
error So how do I tackle this?
submitted by /u/0x69z
[link] [comments]