It is bcoz when you pass an object the address value is passed & stored in some new address ,like if address 2435 is passed , it is stored in 6578 location. So if u change in the value of an object it will take the address from 6578 and do 2435.setXXX(). If you set the object to null it will set 6578=null.