+ 14
Why Java does not support Pointers?
4 Antworten
+ 6
Pointers are used in memory allocation, which is specific to the system. So a program which contains pointers may be influenced by the system at runtime. Java is platform independent, so it doesn't support this.
+ 3
it's explained well here : https://stackoverflow.com/questions/9595636/why-java-doesnt-support-pointers
+ 2
If you asking why there is no direct access to memory locations, that is to guarantee memory access safety. No more segfaults and buffer overruns, no matter how incompetent the programmer (and managed memory is also extremely convenient for a programmer, no matter how competent).
If you are asking why no passing-by-reference, or function pointers, then there are workarounds to achieve the same effect with other constructs.
+ 1
for security purposes. .we don't use pointer