When reference are passed as arguments we can't change the object reference. This changes are reflects only in called method. If the method return the changes are revoked. So Array i1 and i2 has original reference in main method. So Output is displayed as 1,3. If we have change the object values instead of reference, this changes are also reflected in calling method.
Raghu J<br />SCJP 1.4<br /> <br />The Wind and waters are always<br />on the side of the ablest navigators.<br /><a href="http://groups.yahoo.com/group/scjp_share" target="_blank" rel="nofollow">SCJP Group</a><br /><a href="http://groups.yahoo.com/group/JavaBeat_SCWCD" target="_blank" rel="nofollow">SCWCD Group</a>
In Java arrays are Objects, so when you call the method m1(int i4, int i5), the copy of the reference to these array objects are passed. Though you're manipulating the references inside the method it's valid only within the scope of the method m1(), once this method returns the array references are the same as before the call to method m1 is made.