In the case of object reference 'a', the append()
call is changing the object itself.
In the case of object reference 'b', the swap()
method is changing its local object reference
variable 'b'.
Since during a method invocation, a copy of the
reference is passed, the reference 'b' in main()
doesnot get changed. Also, the object refered by
'b' (in the main() method has not changed.
Hence the result.
Right?

. I think it is.
Regds.
- satya