+ 14

Why Java does not support Pointers?

11th Oct 2017, 1:22 PM
Chandrakant More
Chandrakant More - avatar
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.
11th Oct 2017, 2:02 PM
DAB
DAB - avatar
11th Oct 2017, 2:09 PM
O.D, Antonio
O.D, Antonio - avatar
+ 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.
12th Oct 2017, 5:53 PM
Ravish kumar singh
Ravish kumar singh - avatar
+ 1
for security purposes. .we don't use pointer
12th Nov 2017, 9:59 AM
Rkumar
Rkumar - avatar