Purpose of double exclamation operator (null check)

The !! operator tells the compiler that even though the type is nullable, the programmer is sure that the value will not be null in this particular place, and so the null check should be performed and NPE thrown if null value is found.

1 Like