What are the reasons for restricting Java not to support Pointer Manipulations?
Asked
Active
Viewed 451 times
-5
-
5Just see what mess it causes in C++ ad C – Scary Wombat Sep 13 '13 at 06:23
-
Take a look at http://stackoverflow.com/questions/7480783/pointers-in-java – Amin Abu-Taleb Sep 13 '13 at 06:25
-
2That is the reason I love java.No mess,No fuss :) – Suresh Atta Sep 13 '13 at 06:26
-
see http://stackoverflow.com/questions/8080617/why-doesnt-java-have-pointers – krishnakumarp Sep 13 '13 at 06:27
-
Please use Google first. There are plenty of tutorials on this. – Lion Sep 13 '13 at 06:29
2 Answers
0
One reason is improved security. When Java doesn't allow pointers, the programmer is not allowed to freely step around in the computer memory. You also get rid of the C/C++ problem "undefined behavior". The rule of not having pointers in Java is also consistent with the way methods are supposed to be called in Java compared to C/C++ (call by reference).

Niklas Rosencrantz
- 25,640
- 75
- 229
- 424
0
See if you have pointers with you you are free to access physical memory locations that may be used by another process.Which will let you change content at that location corrupting the data used by another process. Pointer therefore pose issues of security and data corruption. Hacking other process's memory is not at all a good idea.

Ajay Bhojak
- 1,161
- 9
- 17