igor.wojda
02/09/2021, 12:41 PMDmitry
02/09/2021, 12:47 PMSurvey
is created.
It is extended from List, because author want it to have all the functionality that list have.
But we don’t want to implement that all by ourselves.
So we delegate all of those methods on List
interface that to actual list with by
keyword.Matteo Mirk
02/09/2021, 1:16 PMwbertan
02/09/2021, 1:27 PMSurvey
also guarantee it will have at least one item in the list.Vampire
02/09/2021, 1:54 PMlistOf
could easily be cast to MutableList
and modified usually.Animesh Sahu
02/09/2021, 2:11 PMThe result ofAtleast on JVM, I remembered,could easily be cast tolistOf
and modified usually.MutableList
listOf()
returns Arrays.asList
which throws runtime exceptions if you try to add or remove something. However it does let you replace items.Vampire
02/09/2021, 2:13 PMjuliocbcotta
02/11/2021, 12:21 PM