How can I change two values concurrently. I am writing a code for b-tree in java. But i am unable to modify two variables at a time. Like in C , we do so by using pointers. But how to do so in java? I hope my question is understandable.
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.
I’m not sure I completely understand your question, but setting an object reference in Java is atomic. You can use that to change a set of multiple values at a time, e.g.: