Hi anut...
you are right but in case of arrays there are two different scenerios.
1)
if you are assigning one array variable to other variable instead of assigning values in array through index then it will not effect the original array
class GFC304 {
static void m1(int[] i1, int[] i2) {
int[] i3 = i1; i1 = i2; i2 = i3;
}
public static void main (
String[] args) {
int[] i1 = {1}, i2 = {3}; m1(i1, i2);
System.out.print(i1[0] + "," + i2[0]);
}}
2)if you are assigning values through index then the original array get effected.
class GFC305 {
static void m1(int[] i1, int[] i2) {
int i = i1[0]; i1[0] = i2[0]; i2[0] = i;
}
public static void main (String[] args) {
int[] i1 = {1}, i2 = {3}; m1(i1, i2);
System.out.print(i1[0] + "," + i2[0]);
}}
[ November 05, 2008: Message edited by: Ganeshkumar cheekati ]