Kotlin: Public getter returns immutable list but private getter should return mutable list

后端 未结 0 1171
醉梦人生
醉梦人生 2020-12-03 04:23

I want my class to have a field that is return an immutable list for all public accesses but inside the object instance I want the list to be mutable so I can add elements t

相关标签:
回答
  • 消灭零回复
提交回复
热议问题