is there ever a reason to use mutable list vs list...
# spring
n
is there ever a reason to use mutable list vs list in spring boot:?
e
In some instances you may need it to populate a list
t
I dnn't know what that has to do with spring boot. If you need a mutable collection in your code, use one. Things that are good to know though: • List and MutableList created by functions like
listOf
and
mutableListOf
are the same actual type in most cases (except empty lists). They mostly just use standard ArrayList. • The differend generics bounds can unexpectedly mess up some Platform calls or apt/kapt-based code generation. So remember: the direct equivalent of a Java List is a Kotlin MutableList.
n
right now im using List in my entity for one to Many
so im wondering does it matter if its Mutable or not