Hi,
When u are passing a reference to the object,in this case it is an array reference,in a method,the reference will remain the same.ie,it will still point to the same object even after the method invocation.But the member variables in the object will change.
For e.g.
class ReferenceTest {
public static void main (
String [] args) {
Dimension d = new Dimension(5,10);
ReferenceTest rt = new ReferenceTest();
System.out.println("Before modify() d.height = " + d.height);
rt.modify(d);
System.out.println("After modify() d.height = " + d.height);
}
void modify(Dimension dim) {
dim.height = dim.height + 1;
System.out.println("dim = " + dim.height);
}
}
You can see that the height of the object d has actually changed after calling the method modify(dim).