Suneet Agrawal
1 min readAug 29, 2018

--

Akshay Dave Thank you for your response.

!! is to tell the compiler that I am sure the value of the variable is not null, and if it is null throw a null pointer exception (NPE) where as ?. is to tell the compiler that I am not sure if the value of the variable is null or not, if it is null do not throw any null pointer exception and if it is not null please perform the operation.

Also, there is no difference in KotlinNullPointer and regular NullPointer.

A null pointer is basically any variable (reference) or pointer which is pointing to null.

Hope this helps. :)

--

--