I'm developing an android application using kotlin and the Android Studio auto completion menu is showing this (I'm elaborating a server response)
As you can see message
and status
are two strings, but one is the first is marked as String!
and the other one as String
, but I don't get the difference
I tried to check in the (java) source code and status
is marked as @NonNull
, while message
does not have any annotation, but if the String can be null in this case in kotlin I should access to it using the !!
operator and it should be marked with ?
, not with !
, because it would be of type String?
.
What is going on here?