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 strings
  • MutableList<String>? is a possibly-null list of strings
  • MutableList<String?>? is a possibly-null list of possibly-null strings
You can learn more about this in:
Run Expand Edit