hello,i am a java novice ,now i meet a problem:
how to exchange two variables in function?
in c++, we can use the point to do this,just like that:
//c++ programme
void exchange(int *a,int *b)
{
int temp=*a;
*a=*b;
*b=temp;
}
int x=3,y=5;
exchange(x,y);
then the values of x and y have exchanged,but how can reach this effect in java ?
thanks!!

