public static void main(String[] args) {
String data = "a";
System.out.println(data);
Append(data);
System.out.println(data);
}
public static void Append(String data) {
data = data + "b";
System.out.println(data);
}
--------------------- --------------------
here append is called as call by value , variable data is local to append only. variable data at main is locl to main, what happen here is a new variable is created at append and intialized with value "a" and concatenated with "b" which is local to append so not reflected in the variable at main because both are different
[ October 04, 2004: Message edited by: sajeer assiz ]