+ 4
Why we can not use pointer in java?
9 Respuestas
+ 11
Java is a most specific design to avoid problems ,when you use to pointer
+ 7
Java uses pointers internally but on the outside you cant chance them like you can in other languages once your varaible is initalized with a refrence then that refrenece will only ever point to that object 😊 even with casting the object remains the same.
+ 6
This is not exists in the language but you can use object and pass it as a reference.
+ 5
No need. Objects are passed by reference by default.
+ 2
To avoid problems associated with pointers in C and C++, in java concept of pointers are removed.
As well as due to not refrencing directly to the address java becomes more secure than other.
+ 2
In C and C++ due to the Pointer we can access memory locations which not secure and for overcome these ,in Java there is not concept of pointers, so that no one can access the memory location
+ 1
The very first reason for this isPointers cannot be used in Javabecause pointers don't exist in Java .
+ 1
Jav is high level programming language.
+ 1
when java was developed the main aim is to overcome the bugs in c & C++.
One of the major bugs in those were pointers as the pointers may initialized to garbage value and for dynamic programming we need to de-allocate the pointer memory address but in java it has the concept of automatic garbage collector and passing the pointer in args would cause the security issues as anyone can refer to the main var and access the value so java provides more security by not using pointers and moreover it uses pointers internally which a user can't use ..as java uses its own vm for compiling its memeory is dynamically generated so pointing to one memory can be lost if compiled again to POINTERS ARE NOT USED IN JAVA