This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
In Java, everything is passed by value. Primitives are copied and passed on to the method and references are copied also but they still reference the same object on the heap. If you want to pass a primitive by reference, the only I know of is to wrap it in an array and pass the array to the method. For instance,
This code also provide same result as yours but it proves the point you are trying to make. Or am I off-the-base here? Thanks Barkat [ August 18, 2002: Message edited by: Barkat Mardhani ] [ August 18, 2002: Message edited by: Barkat Mardhani ]