Originally posted by Sudha Kris: In this code.IMO the output should have been "String Java Stringbuffer Java" But I am getting String Java Stringbuffer Java2" Why is it, I know String is immutable,but the method is not returning any value & the String & Stringbuffer are not static.But still how can the output be like that? public class str{ public static void Change(String x,StringBuffer y){ x=x.concat("2"); y=y.append("2"); } public static void main(String args[]){ String s = "Java"; StringBuffer sb = new StringBuffer("Java"); Change(s,sb); System.out.println("String "+s+" Stringbuffer "+sb); //The output is String Java Stringbuffer Java2 //Whynot String Java Stringbuffer Java ? } } Can anybody comment on this, Thanks Sudha