I want to change two variables at once like when i set one to a value the other one is set to the same value . i used to do it with pointers in c++ but there are no pointers in java so i don't know how to do it . thanks in advance

This depends on whether the value is a primitive (int etc) or an object. If it's an object then all your variables are pointers (references) anyway.

commented: Yes; exactly. +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.