In the code below, I dont see why the value of "foo" remains unchanged in the method - changeFoo().
Output of this program is : I am foo
public class q1{
public static void changeFoo(StringBuffer foo) {
foo = new StringBuffer("I am not foo");
}
public static void main(
String args[])
{
StringBuffer foo = new StringBuffer("I am foo");
changeFoo(foo);
System.out.println(foo.toString());
}
}