View Single Post
Old May 25th, 2006, 8:13 AM   #2
Toro
Hobbyist Programmer
 
Toro's Avatar
 
Join Date: Apr 2006
Posts: 136
Rep Power: 0 Toro is an unknown quantity at this point
First of all, there is not array in the above code.
[PHP]
public class Test
{
public void someMethod()
{
int array[] = new int[10];
passArray(array);
}
public void passArray(int array2[])
{
//do whatever to the array
}
}
[/PHP]
You pass an array through a method via arguments. What ever you do to that array2, array 's value takes that same effect as if it was the array itself.
Toro is offline   Reply With Quote