top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

When an object is passed through a function, why one can set the properties but cannot set a new memory location?

+5 votes
114 views
When an object is passed through a function, why one can set the properties but cannot set a new memory location?
posted Sep 23, 2013 by Arvind Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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.

answer Sep 23, 2013 by Vivek Singh
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...