-5

What are the reasons for restricting Java not to support Pointer Manipulations?

Shivam
  • 674
  • 1
  • 4
  • 25

2 Answers2

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