Why Java Does Not Support Pointers?
Below are some reasons why Java does not support pointers.
Although there are various advantages of pointer but it has several disadvantages that I have mentioned in the article.
The pointer concept is very confusing, difficult to understand (especially for beginners) and causes bugs in code. To make java simpler and less complex the java creators decided to remove the concept of pointers.
Security is one of the biggest issue in programming world. Pointer provides direct access to memory address. One can access some arbitrary memory location and do read and write operations on it. This results in loss of security. So to make java secure it doesn’t support pointers.
Pointers can be used to allocate and deallocate memory. This is good feature of pointers but sometimes it causes headache for programmers to manage memory manually. As java provides the automatic garbage collection feature so there is no need of pointers and it makes memory management easier.
Java doesn’t provide any explicit option to use pointers but internally pointers are used. Java has the concept of reference which is more simple and secure than pointer.
Comment below if you found any information incorrect or missing in above article.