Thanks,peter,though,I know the exact details of both but I was unable to explain it somebody who asked .
One more question I would like (that is diffrent from this one),I want to swap two strings thru a method like swap(String str,String str1).
but passing thru reference does not work,do you know How can I swap values of String thru method.
Is this possible as strings are immutable.