Is there anything similar to C++ pointers in Java? If there is, I would like to know what it is. Could you give me some examples?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Java’s pointers (so called by the language specification, while I believe Java programmers mostly know them as “references”) do not support pointer arithmetic.
And Java has no way to do pointer arithmetic.
If you want to do such low-level stuff in Java, one way is to use JNI (the Java Native Interface) to access code written in C or C++.