https://kotlinlang.org logo
j

jstuyts-squins

10/06/2017, 1:28 PM
If you always use
listOf(...)
or
emptyList()
for the construction of lists, you can be sure that all of your lists are immutable. But if you receive/retrieve a
List
from somewhere else, you cannot be sure that it is immutable, unless the documentation/code explicitly says that it will never be modified