Ananiya
04/23/2020, 11:57 AMclass SettingMyValue{ var setLength = 9 }
and from external kt file i put this code SettingMyValue().setLength = 7
to reassign the value of setLength
externally but it return 9 but all i want was to print the reassigned value (7) and if there is no external change returns 9Kroppeb
04/23/2020, 12:10 PMSettingMyValue()
creates a new object. Each object will have it's own setLength
variable.
Maybe you want object SettingMyValue
? If that doesn't work, you could add it to the companion object
instead.Ananiya
04/23/2020, 12:29 PMKroppeb
04/23/2020, 1:38 PMKroppeb
04/23/2020, 1:40 PM