It provides direct access to that variable’s value and addresses. The pointer is a special variable that contains the address of the specified variable. Pointer - Every variable has a memory and every memory has its own address and location. So when a variable points to null it points to nothing. If it is assigned to a variable that means that variable has no value at all. Let’s see how beautifully kotlin handles nulls. That’s why when JetBrains team designs the kotlin they put a fair focus on handling null and they came up with a magical solution which is really very effective to provide safety against nulls. Null pointer was one of the most painful exceptions for android and java developers. More than 70% of apps crash in its lifetime due to null pointer exception. If you ask any android or java developer about the scariest exception, he/she will say only one name and that is NPE or Null Pointer Exception.
0 Comments
Leave a Reply. |