Nullability in Kotlin
Null Safety or Nullability We have discussed the basic introduction of Kotlin, if you wish to have a look Here you go !! Kotlin includes nullable types, which can represent the absence of value. Basically, we can use it to represent the value and absence of that value as well. You might have heard of options in swift. It's the same way. var error: Int? Marking with? This means either it will have the Int or no value. error = 100 error = nullvar error: Int? As you know in swift optional value being wrapped in the optional type so when you try to print the value it will not be like a primitive Int value. You need to unwrap it the same way we are also going the do the same. Not-null assertion operator (!!) which is used to unwrap the value from it. error !! + 1 Seems it like as in iOS, force unwrapped an optional value with null as the value will make the app crash same way here as well you will get the null-pointer excepti...