However, to avoid some of the pitfalls of C’s pointers, Java introduced a new concept called references, which are similar to pointers but have some important differences. When Java was created, it adopted many of the concepts and syntax of C, including the concept of pointers. When a pointer is uninitialized or set to null, it points to no valid memory location, and attempting to dereference it can result in a runtime error. In C, a pointer is a variable that stores the memory address of another variable or object. The term “null pointer” is historically used in the C programming language, which is one of the oldest programming languages still in use today.
0 Comments
Leave a Reply. |