+ 4

Why we can not use pointer in java?

10th Aug 2019, 3:31 PM
Ramniwas Kumawat
Ramniwas Kumawat - avatar
9 Respuestas
+ 11
Java is a most specific design to avoid problems ,when you use to pointer
11th Aug 2019, 9:48 AM
🌠Ratnesh Rakesh Ranjan 🇮🇳
🌠Ratnesh Rakesh Ranjan 🇮🇳 - avatar
+ 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.
10th Aug 2019, 4:38 PM
D_Stark
D_Stark - avatar
+ 6
This is not exists in the language but you can use object and pass it as a reference.
10th Aug 2019, 3:32 PM
Potato Squad
Potato Squad - avatar
+ 5
No need. Objects are passed by reference by default.
10th Aug 2019, 10:24 PM
Sonic
Sonic - avatar
+ 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.
11th Aug 2019, 9:38 AM
karan
karan - avatar
+ 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
12th Aug 2019, 1:16 PM
kunal patil
kunal patil - avatar
+ 1
The very first reason for this isPointers cannot be used in Javabecause pointers don't exist in Java . 
11th Aug 2019, 7:24 AM
anjali srivastava
anjali srivastava - avatar
+ 1
Jav is high level programming language.
12th Aug 2019, 4:39 AM
Dimitrios
Dimitrios - avatar
+ 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
12th Aug 2019, 5:14 AM
Aadhithya
Aadhithya - avatar