![]() ![]() In Java, you can directly assign null to any variable or object type. Null pointer exception is thrown when an application tries to use an object or variable reference that has the null value in it. Null pointer Exception - null pointer is a runtime exception. Null pointer - In computer programming, a null pointer is a pointer that does not point to any object or function. 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |