The outer type (MutableList
in MutableList<String>
) can also be marked with ?
to indicate that it could be null
. So, we have a few combinations:
MutableList<String?>
is a list of possibly-null
stringsMutableList<String>?
is a possibly-null
list of stringsMutableList<String?>?
is a possibly-null
list of possibly-null
strings
You can learn more about this in:
Tags: