+17

Qus:- Why pointers are not used in Java?

#basicjavaquestion

5/14/2019 2:08:19 PM

Deepika Mourya

6 Answers

New Answer

+14

https://www.quora.com/Why-dont-we-use-pointers-in-Java-but-we-use-them-in-C-and-C++

+8

http://net-informations.com/java/cjava/pointers.htm

+7

Java cannot allow pointers, because doing so would allow Java programs to breach the firewall between the Java execution environment and the host computer. (Remember, a pointer can be given any address in memory—even addresses that might be outside the Java run-time system.) Java is designed in such a way that as long as you stay within the confines of the execution environment, you will never need to use a pointer, nor would there be any benefit in using one.

+3

In simple way Java is a more powerful language than c++ where pointer is used. Pointer concept came in c++ because of these reasons. 1. To maintain the support criteria of C where pointer were used. 2.pointer gives security in c++ where in java it is not needed 3. But sometimes pointer creates fault in memory also as it directly play with the memory address of your device which is not good.

+1

we will n ever use a POINTER BCOZ, there is no benefit in using it

+1

Because java is static language, so we cannot use pointers.