+1 vote
in JAVA by
Pointers are used in C/ C++. Why does Java not make use of pointers?

1 Answer

0 votes
by

Pointers are quite complicated and unsafe to use by beginner programmers. Java focuses on code simplicity, and usage of pointers can make it challenging. Pointer utilization can also cause potential errors. Moreover, security is also compromised if pointers are used because the users can directly access memory with the help of pointers.

Thus, a certain level of abstraction is furnished by not including pointers in Java. Moreover, the usage of pointers can make the procedure of garbage collection quite slow and erroneous. Java makes use of references as these cannot be manipulated, unlike pointers.

Related questions

+1 vote
asked Dec 7, 2020 in JAVA by SakshiSharma
+1 vote
asked Dec 7, 2020 in JAVA by SakshiSharma
...